I want to fill selectonemenu, but always have this error:
java.lang.String cannot be cast to javax.faces.model.SelectItem
this is the code:
public class ToolsJIRA implements Serializable{ private String myChoicePeriod;
JSF:
<h:selectOneMenu value="#{ToolsJIRA.myChoicePeriod}"> <f:selectItem itemValue="Month" value="Month"/> <f:selectItem itemValue="Week" value="Week"/> <f:selectItem itemValue="Year" value="Year"/> </h:selectOneMenu>
I found that I should write a converter, but I do not know why? beacause I saw an example of working without a converter ??
Thank you
source share