ICE:selectonemenu partial submit selects null for first time then lags one step behind
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
ICE:selectonemenu partial submit selects null for first time then lags one step behind  XML
Forum Index -> Components
Author Message
svanteru

Joined: 10/03/2010 00:00:00
Messages: 6
Offline


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.
svanteru

Joined: 10/03/2010 00:00:00
Messages: 6
Offline


I can't believe that no one has same problem. Or i want to know is it a bug, if it is then i will move to different implementation
radu.jakab

Joined: 31/10/2007 00:00:00
Messages: 240
Offline


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).
svanteru

Joined: 10/03/2010 00:00:00
Messages: 6
Offline


Code:
 My Code is as follows:
 
 <ice:dataTable var="request" value="#form.requests}" binding="#{form.table}">
 
 <ice:column>
 
 <f:facet name="header">
 <ice:outputText styleClass="headerColumn" value="Level"/>
 </f:facet>
 <ice:selectOneMenu value="#{request.newLevel}" valueChangeListener="#{form.levelChanged}" partialSubmit="true">
 <f:selectItems value="${form.levelOptions}" />
 </ice:selectOneMenu>
 </ice:column>
 </ice:dataTable>
 
 
svanteru

Joined: 10/03/2010 00:00:00
Messages: 6
Offline


Code:
 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? 
 
 
radu.jakab

Joined: 31/10/2007 00:00:00
Messages: 240
Offline


Hi,

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.

Regards,
Radu
svanteru

Joined: 10/03/2010 00:00:00
Messages: 6
Offline


Thanks....
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team