-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, i have a listbox one column have a decimalbox, when i need to save data i loop the list and i set a custom constraint on each decimalbox, then i loop the listbox again to fire the constraints (set focus, get value). But sometimes the message constraint dissapear, simply doesn't show it, and the red rectangle no show either; i don't know the possible reason. Has anyone had a similar problem?
i'm using MVVM
If you call getValue()
inside, that will throw WrongValueException
and break the loop. So you will just trigger one error message in the end.
Hence, it's better to validate it and call decimalbox.setErrorMessage()
to show errors for all decimalboxes.
If this is not your case, please show the code about how you trigger constraint errors.
@hawk thanks for your answer here the code:
for (Listitem fila:listbox.getItems()) {
if (fila.getChildren().get(3).getChildren().get(0) instanceof Decimalbox) {
Decimalbox dbox = (Decimalbox)fila.getChildren().get(3).getChildren().get(0);
dbox.setFocus(true);
}
}
button.setFocus(true);
for (Listitem fila:listbox.getItems()) {
Component comp = fila.getChildren().get(3).getChildren().get(0);
if (comp instanceof Decimalbox) {
Decimalbox dbox = (Decimalbox)comp;
try {
dbox.getValue();
} catch (WrongValueException e) {
LOGGER.error(e.getMessage());
throw e;
}
}
}
button.setFocus(true);
i don't why sometimes work, sometimes don't
Asked: 2022-02-15 06:00:22 +0800
Seen: 5 times
Last updated: Feb 16 '22
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver