Dear Support
In my application I want to populate the helperText from a database.
@Subscribe
protected void onInit(InitEvent event) {
initNotificationField();
}
protected void initNotificationField()
{
String helpText = dataManager.loadValue("select e.nlsHelp from TNL e where e.nlsGuid = :field", String.class)
.parameter("field","Contact.salutation.de").one();
if ( !helpText.isEmpty() ) {
JmixButton helperButton = createHelperButton();
helperButton.addClickListener(event ->
notifications.create(helpText)
.withCloseable(true)
.show());
conSalutationField.setSuffixComponent(helperButton);
}
}
In a classic java programm I would extend the textField class with the helperfunctionality.
How to proceed in JMix ?
- does it make sense to overwrite the textField constructor ?
- or should i go through the list of all textField’s in the init phase and check if there is help available in the database ?
Thank you for your advise !
Felix