From 945032fac603ecbe82c75423920c8b9309c9e940 Mon Sep 17 00:00:00 2001 From: Laura Toedtli Date: Thu, 3 Sep 2026 14:30:03 +0200 Subject: [PATCH 1/4] Introduce placeholder to formfields If field supports it, the configured placeholder is shown when the field is empty 396946 --- .../js/formfield/FormFieldPropertiesBox.ts | 4 ++++ .../formfield/FormFieldPropertiesBoxModel.ts | 6 +++++ .../AbstractFormFieldPropertiesBox.java | 23 +++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBox.ts b/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBox.ts index 55a6bf4640..efc0254590 100644 --- a/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBox.ts +++ b/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBox.ts @@ -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)); diff --git a/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBoxModel.ts b/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBoxModel.ts index 7f489f6352..085641e802 100644 --- a/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBoxModel.ts +++ b/code/widgets/org.eclipse.scout.jswidgets.ui.html/src/main/js/formfield/FormFieldPropertiesBoxModel.ts @@ -142,6 +142,11 @@ export default (): GroupBoxModel => ({ lookupCall: LabelWidthInPixelLookupCall, label: 'Label Width in Pixel' }, + { + id: 'PlaceholderField', + objectType: StringField, + label: 'Placeholder' + }, { id: 'TooltipTextField', objectType: StringField, @@ -193,6 +198,7 @@ export type FormFieldPropertiesBoxWidgetMap = { 'LabelField': StringField; 'LabelPositionField': SmartField; 'LabelWidthInPixelField': ProposalField; + 'PlaceholderField': StringField; 'TooltipTextField': StringField; 'TooltipAnchorField': SmartField; 'ErrorStatusField': SmartField; diff --git a/code/widgets/org.eclipse.scout.widgets.client/src/main/java/org/eclipse/scout/widgets/client/ui/forms/fields/formfield/AbstractFormFieldPropertiesBox.java b/code/widgets/org.eclipse.scout.widgets.client/src/main/java/org/eclipse/scout/widgets/client/ui/forms/fields/formfield/AbstractFormFieldPropertiesBox.java index 6f56c6cf9e..6bdf39f92f 100644 --- a/code/widgets/org.eclipse.scout.widgets.client/src/main/java/org/eclipse/scout/widgets/client/ui/forms/fields/formfield/AbstractFormFieldPropertiesBox.java +++ b/code/widgets/org.eclipse.scout.widgets.client/src/main/java/org/eclipse/scout/widgets/client/ui/forms/fields/formfield/AbstractFormFieldPropertiesBox.java @@ -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 { @@ -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 { From 4060f3d02d4c4b0f9b7850bab154ff841cdbafce Mon Sep 17 00:00:00 2001 From: Laura Toedtli Date: Tue, 15 Sep 2026 13:35:16 +0200 Subject: [PATCH 2/4] release notes --- .../partials/migration-guide-27.1.adoc | 17 +++++++++++++++++ .../partials/release-notes-27.1.adoc | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/docs/modules/migration/partials/migration-guide-27.1.adoc b/docs/modules/migration/partials/migration-guide-27.1.adoc index e3515e4bd1..4fb93ca011 100644 --- a/docs/modules/migration/partials/migration-guide-27.1.adoc +++ b/docs/modules/migration/partials/migration-guide-27.1.adoc @@ -119,3 +119,20 @@ 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 the `AbstractFormField` level and is therefore available throughout the form field hierarchy. +As a consequence, this change may affect existing customizations in your project. + +New API methods: + +* `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()` + +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, rename them to avoid naming conflicts and unintended behavior. + diff --git a/docs/modules/releasenotes/partials/release-notes-27.1.adoc b/docs/modules/releasenotes/partials/release-notes-27.1.adoc index 3f4835abde..a5e29890f5 100644 --- a/docs/modules/releasenotes/partials/release-notes-27.1.adoc +++ b/docs/modules/releasenotes/partials/release-notes-27.1.adoc @@ -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 + +`AbstractFormFields` can now be configured with placeholder text by overwriting `AbstractFormField.getConfiguredPlaceholder`. +If supported by the field type, the configured text is displayed when the field is empty. From 5614e046a9b1d7e6046c639dac04fdd01ef632f4 Mon Sep 17 00:00:00 2001 From: Laura Toedtli Date: Wed, 16 Sep 2026 13:47:23 +0200 Subject: [PATCH 3/4] implement feedback --- .../partials/migration-guide-27.1.adoc | 19 ++++++++++++------- .../partials/release-notes-27.1.adoc | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/modules/migration/partials/migration-guide-27.1.adoc b/docs/modules/migration/partials/migration-guide-27.1.adoc index 4fb93ca011..22ac77eb0b 100644 --- a/docs/modules/migration/partials/migration-guide-27.1.adoc +++ b/docs/modules/migration/partials/migration-guide-27.1.adoc @@ -122,17 +122,22 @@ In Scout JS the function `Table.setLimitedResultTableStatus` was renamed to `Tab == Support for placeholders -Placeholder support has been added at the `AbstractFormField` level and is therefore available throughout the form field hierarchy. +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. -New API methods: +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()` +- `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` +- `FormFieldModel.placeholder` 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, rename them to avoid naming conflicts and unintended behavior. +- 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. diff --git a/docs/modules/releasenotes/partials/release-notes-27.1.adoc b/docs/modules/releasenotes/partials/release-notes-27.1.adoc index a5e29890f5..4b148df232 100644 --- a/docs/modules/releasenotes/partials/release-notes-27.1.adoc +++ b/docs/modules/releasenotes/partials/release-notes-27.1.adoc @@ -50,5 +50,5 @@ Furthermore, `StaticLookupCall` is now batched. == Support for placeholders -`AbstractFormFields` can now be configured with placeholder text by overwriting `AbstractFormField.getConfiguredPlaceholder`. +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. From 7fd0c49346cfef50a5c279b7623987c0fb9299ca Mon Sep 17 00:00:00 2001 From: work-lto Date: Thu, 17 Sep 2026 15:37:01 +0200 Subject: [PATCH 4/4] Update docs/modules/migration/partials/migration-guide-27.1.adoc Co-authored-by: Claudio Guglielmo --- docs/modules/migration/partials/migration-guide-27.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/migration/partials/migration-guide-27.1.adoc b/docs/modules/migration/partials/migration-guide-27.1.adoc index 22ac77eb0b..30d709f3d2 100644 --- a/docs/modules/migration/partials/migration-guide-27.1.adoc +++ b/docs/modules/migration/partials/migration-guide-27.1.adoc @@ -134,7 +134,7 @@ Scout Classic Scout JS - `FormField.placeholder` -- `FormFieldModel.placeholder` +- `FormField.setPlaceholder(string)` Please review your project for potential conflicts: