Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export class FormFieldPropertiesBox extends GroupBox {
}
});

let placeholderTextField = this.widget('PlaceholderField');
placeholderTextField.setValue(this.field.placeholder);
placeholderTextField.on('propertyChange:value', event => this.field.setPlaceholder(event.newValue));

let tooltipTextField = this.widget('TooltipTextField');
tooltipTextField.setValue(this.field.tooltipText);
tooltipTextField.on('propertyChange:value', event => this.field.setTooltipText(event.newValue));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ export default (): GroupBoxModel => ({
lookupCall: LabelWidthInPixelLookupCall,
label: 'Label Width in Pixel'
},
{
id: 'PlaceholderField',
objectType: StringField,
label: 'Placeholder'
},
{
id: 'TooltipTextField',
objectType: StringField,
Expand Down Expand Up @@ -193,6 +198,7 @@ export type FormFieldPropertiesBoxWidgetMap = {
'LabelField': StringField;
'LabelPositionField': SmartField<any>;
'LabelWidthInPixelField': ProposalField;
'PlaceholderField': StringField;
'TooltipTextField': StringField;
'TooltipAnchorField': SmartField<any>;
'ErrorStatusField': SmartField<any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public FieldStyleField getFieldStyleField() {
return getFieldByClass(FieldStyleField.class);
}

public PlaceholderField getPlaceholderField() {
return getFieldByClass(PlaceholderField.class);
}

@Order(1000)
@ClassId("c136fb40-c06e-4c76-8020-68e5d21b5f90")
public class EnabledField extends AbstractBooleanField {
Expand Down Expand Up @@ -397,6 +401,25 @@ protected void execInitField() {
}
}

@Order(10500)
@ClassId("8b79e63a-f3bc-4e53-ad18-638a59ae4b48")
public class PlaceholderField extends AbstractStringField {
@Override
protected String getConfiguredLabel() {
return "Placeholder";
}

@Override
protected void execChangedValue() {
m_field.setPlaceholder(getValue());
}

@Override
protected void execInitField() {
setValue(m_field.getPlaceholder());
}
}

@Order(11000)
@ClassId("39042fa7-8106-4794-92ff-f0fa47519f6a")
public class ErrorStatusField extends AbstractSmartField<Integer> {
Expand Down
22 changes: 22 additions & 0 deletions docs/modules/migration/partials/migration-guide-27.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,25 @@ In Scout Classic the following methods have been moved:
So intead calling these methods on the page, call them on the corresponding Table. E.g. `myPage.getTable().setResultInfo()`.

In Scout JS the function `Table.setLimitedResultTableStatus` was renamed to `Table.updateLimitedResultTableStatus` and requires no argument anymore as the table now directly holds the `limitedResult` property. Furthermore, the function `TableMaxResultsHelper.isLoadMoreDataPossible` now requires the whole table as argument for maximum flexiblity.

== Support for placeholders

Placeholder support has been added at top level and is therefore available throughout the form field hierarchy.
As a consequence, this change may affect existing customizations in your project.

Scout Classic

- `org.eclipse.scout.rt.client.ui.form.fields.IFormField.getPlaceholder()`
- `org.eclipse.scout.rt.client.ui.form.fields.IFormField.setPlaceholder(String)`
- `org.eclipse.scout.rt.client.ui.form.fields.AbstractFormField.getConfiguredPlaceholder()`

Scout JS

- `FormField.placeholder`
- `FormField.setPlaceholder(string)`

Please review your project for potential conflicts:

- If you have implemented custom placeholder functionality, consider removing or migrating those customizations to the new built-in API.
- If you have introduced custom methods named `getPlaceholder()`, `setPlaceholder()`, or similar on form fields, consider renaming them to avoid naming conflicts and unintended behavior.

5 changes: 5 additions & 0 deletions docs/modules/releasenotes/partials/release-notes-27.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ Refer to the JsDoc of the class for details and a usage example.

The new batch support is used by default by the `SmartColumn` and the `LookupColumn`.
Furthermore, `StaticLookupCall` is now batched.

== Support for placeholders

Form fields can now be configured with placeholder text.
If supported by the field type, the configured text is displayed when the field is empty.