I am using ice:selectonemenu for selecting job number and using output text to show corresponding job name and job code. i used print statement to see whats is selected. When i select for first time from drop down it selects null and from there on its always one step behind. I think its binding issue. Thanks for your help.
Hi,
Please post the page code of your job number ice:selectOneMenu, and the bean code (or at least parts that deal with any variables involved with the menu).
In form :
public void levelChanged(ValueChangeEvent e){
RequestInfo info= (RequestInfo ) table.getRowData();
System.out.println("New Level selected "+info.getNewLevel() +" newSelectedLevel " +e.getNewValue() ) ;
}
Now the problem is e.getNewValue() gives the selected Level where as info.getNewLevel() gives previous selected level. I need to get hold of the selected request object in my form.
I am using Icefaces 1.8.2 . Any Clue?
Try adding this to the beginning your listener:
Code:
if (!e.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) {
e.setPhaseId(PhaseId.INVOKE_APPLICATION);
e.queue();
return;
}
The reason why this happens is that the event is processed first in PROCESS_VALIDATIONS phase, which is before UPDATE_MODEL_VALUES, when the value from the page gets written to your bean.