What is the best way to create a screen that is not linked to a datasource or to a backend physical screen?
In other terms, I need to create an “run billing input” screen that captures parameters from the user and then generates invoices accordingly. The actual parameters are not linked to a datasource or table.
I have tried to create a UI without creating an entity, and built the xml file manually.
However, I am getting the following error:
GuiDevelopmentException: Datasource is not defined for FieldGroup field ‘fromDate’. Only custom fields can have no datasource.
Please advise on the best approach to achieve this.
FieldGroup component cannot work without a datasource. So you should either use individual components like TextField, LookupField, etc., or create a non-persistent entity and use FieldGroup with a datasource containing this entity.
Will listeners such as “addItemPropertyChangeListener” work on fields belonging to non-persistent entities?
I need to display some message when the user key in some values in some fields. So as I used to do with persistent entities, I am overriding the method postInit() and the code is something like:
runBillingDs.addItemPropertyChangeListener(e -> {
if (e.getProperty().equals(“customerGroup”)) {
etc…
However, the debugger never goes into the listener or the if statement.
Yes the listeners should work for non-persistent entities in the same way as for persistent. Could you provide a sample project demonstrating the issue?
RunBillingEdit.java (the screen controller and its xml file)
I need to load the FromDate field based on the customer group chosen. The debugger would go into the postInit() method only the first time the screen loads (in which case customer group is null), then when I change the value of customer group, the method is not trigered.