| Author |
Navigation using valueChangeListener
|
Abiodun Adisa
Ranch Hand
Joined: Jan 17, 2002
Posts: 495
|
|
I have this selectOneMenu and i would like the Page to navigate to another page whenever the user selects an item from the drop down that is when the valueChangeListener is fired. Pls how do i go about this <h:selectOneMenu binding="#{backing_index2.selectOneMenu1}" id="selectOneMenu1" onchange="submit()" valueChangeListener="#{backing_index.valueChanged}"> <f:selectItem itemLabel="juju" itemValue="jubril" binding="#{backing_index2.selectItem1}" id="selectItem1"/> <f:selectItem itemLabel="dodo" itemValue="abiodun" binding="#{backing_index2.selectItem2}" id="selectItem2"/> <f:selectItem itemLabel="remi" itemValue="jubril" binding="#{backing_index2.selectItem3}" id="selectItem3"/> </h:selectOneMenu>
|
 |
Ravindra Rawat
Ranch Hand
Joined: Dec 09, 2004
Posts: 34
|
|
You can try the following, Use navigation handler to go to desired page as per selected item and stop furtehr JSF processing using the FacesContext.responseComplete(). FacesContext ctx = FacesContext.getCurrentInstance(); ctx.getApplication().getNavigationHandler().handleNavigation(...); ctx.responseComplete(); Ravindra "Hello World"
|
 |
 |
|
|
subject: Navigation using valueChangeListener
|
|
|