Hi All,
I have a selectonemenu in my
jsf page and i need to navigate to different pages based on the value selected in the selectonemenu.
I tried two approaches:
1. First approach is to have a hidden button and then invoking the action of the button when the selectonemenu is clicked. This gives me 'hX_5 is undefined' javascript error, even though the hxclient_v3_0.js is included in the page. Below is the code snippet for the same.
<h:selectOneMenu id="menCategory" styleClass="selectOneMenu" value="#{pc_AdvancedDeal.menuCategory}">
<h:selectItem....
<hx:behavior event="onchange" target="menCategory" behaviorAction="click" targetAction="buttonNav"></hx:behavior>
</h:selectOneMenu>
<hx:commandExButton style="display:none" type="submit" value="Submit" id="buttonNav" styleClass="commandExButton" action="#{pc_AdvancedDeal.doButtonNavAction}"></hx:commandExButton>
2. Second approach is to navigate to the required page using response.sendRedirect in the valueChangeListener for the selectonemenu.
With this approach, the control comes back to the initial page and no navigation happens.
Please help. This is very urgent.
Thanks and Regards,
Anitha.