This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Navigation using  valueChangeListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Navigation using  valueChangeListener" Watch "Navigation using  valueChangeListener" New topic

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()"
<f:selectItem itemLabel="juju" itemValue="jubril"
<f:selectItem itemLabel="dodo" itemValue="abiodun"
<f:selectItem itemLabel="remi" itemValue="jubril"
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();

"Hello World"
Consider Paul's rocket mass heater.
subject: Navigation using valueChangeListener
Similar Threads
Seam/RichFaces - extendedDataTable, datascroller, and changeable page size
Validating a selectOneMenu
selectOneListbox error - choosing menyitems rapidly
can anybody help ??
A Problem with events