Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void myValChanged(ValueChangeEvent event) {
- try {
- validate(event.getNewValue());
- myValue = event.getNewValue();
- } catch (Exception ex) {
- /*
- Listeners are called before update model values in the request lifecycle so any changes you make in that phase are overwritten by the actual values in the page.
- By changing the event's phase to UPDATE_MODEL_VALUES or INVOKE_APPLICATION your changes will overwrite those currently set in the page, which is what you need.
- */
- myValue = event.getOldValue();
- if (!event.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
- event.queue();
- return;
- }
- }
- }
Add Comment
Please, Sign In to add comment