How to get itemValue of selected radio button in action of commandButton ?
I am new to JSFs and still learning the basics.
<html>
<head><title>Search by Catagory</title></head>
<body>
<h:form>
<h:selectOneRadio id = "searchCatagory" layout = "pageDirection" value = "#{SearchCatagory.searchCatagoryPage}" required = "true" onclick = "sameInfo()" >
<f:selectItem itemLabel = "Search for Cars" itemValue = "cars"/>
<f:selectItem itemLabel = "Search for Trucks" itemValue = "trucks"/>
</h:selectOneRadio>
<h:commandButton value = "Continue" action = "#{SearchCatagory.searchCatagoryPage}"/>
</h:form>
</body>
</html>
All these radio buttons and 'continue' button exist on the same page.
In this code i am trying to get the value of a selected radio button in the action parameter of commandButton.
So, for example, when i select 'Search for Cars' and click on the 'Continue' button it should take me to car.jsp. But, instead it gives this error message:
17:48:44,728 FATAL [application] org.apache.jasper.el.JspMethodNotFoundException: /jsp/SearchCatagoryPage.jsp(35,5) '#{SearchCatagory.searchCatagoryPage}' Method not found: gov.ca.ftb.accounts.SearchCatagory@151b1b7.searchCatagoryPage()
javax.faces.el.MethodNotFoundException: org.apache.jasper.el.JspMethodNotFoundException: /jsp/SearchCatagoryPage.jsp(35,5) '#{SearchCatagory.searchCatagoryPage}' Method not found: gov.ca.ftb.accounts.SearchCatagory@151b1b7.searchCatagoryPage()
I am using value = "#{SearchCatagory.searchCatagoryPage}" in the selectOneRadio, to initially set the default value. And that is working fine.
If i hard code the value like action = "cars" or action="trucks", then it works fine; It nevigates to the right page.
For some reason it doesnot like action = "#{SearchCatagory.searchCatagoryPage}" in commandButton.
Help please.
Thank you in advance.

