Forums Register Login

Navigation using valueChangeListener

+Pie Number of slices to send: Send
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>
+Pie Number of slices to send: Send
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"
Liar, liar, pants on fire! refreshing plug:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2737 times.
Similar Threads
can anybody help ??
A Problem with events
Seam/RichFaces - extendedDataTable, datascroller, and changeable page size
selectOneListbox error - choosing menyitems rapidly
Validating a selectOneMenu
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:57:56.