How to put a placeholder in create screen

Hi community,

I want to ask, how I can add a placeholder to a field of a column of a create screen.

If I use placeholder=“Integer Value” for a field in column (XML), it doesnt work.

Does anyone have a hint for me?

Thanks

Hi,

Unfortunately, it cannot be set from XML if you use FieldGroup. Inject the target field and assign inputPrompt property programmatically:

@Named("fieldGroup.name")
private TextField nameField;
// ...
// for instance, we can get hint text from messages.properties
nameField.setInputPrompt(getMessage("name.inputPrompt"));

See also: https://doc.cuba-platform.com/manual-6.8/gui_attributes.html#gui_attr_inputPrompt

We are planning to introduce inputPrompt for FieldGroup declarative fields in the next minor release 6.9: https://youtrack.cuba-platform.com/issue/PL-10432