I’ve only been using Ice:faces for a week now and I’m having problems figuring out how to implement a simple selectOneMenu to my page so I can select a gender of a person by a simple drop down rather then typing stuff in.
The error im getting is the following
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.el.MethodNotFoundException: Method not found: data.SelectMenuHomes@ad503c.selectedGender(javax.faces.event.ValueChangeEvent)
note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1.1 logs.
so i figured im obviously refering to something that isnt there
here is my code
In the page jsp form :
<ice:selectOneMenu valueChangeListener="#{homeSelect.selectedGender}">
<f:selectItems value="#{homeSelect.genders}"/>
</ice:selectOneMenu>
the class for the select menu :
import java.util.LinkedList;
import java.util.List;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
public class SelectMenuHomes
{
public static String selectedGender = null;
public static void changeGender(ValueChangeEvent event)
{
selectedGender = event.getNewValue().toString();
}
public List<SelectItem> getGenders()
{
List<SelectItem> genderList = new LinkedList<SelectItem>();
genderList.add(new SelectItem("Male"));
genderList.add(new SelectItem("Female"));
return genderList;
}
public String getSelectedGender() {
return selectedGender;
}
public void setSelectedGender(String selectedGender) {
this.selectedGender = selectedGender;
}
}
and homeSelect is the name for the managed bean I gave to refer to the MenuSelectHomesClass
thank you for any help
Solved
appendGender is the variable used in the method to run the SQL query along with variables like appendName appendSurname etc etc