jboss - primefaces does not render f:selecteditems -
here mycode: there might mistakes doing right, thinking problem in java code can please throw light, trying render radio values.
<p:selectoneradio id="firstbill" value="#{myclass.myfee}" label="what do?"> <f:verbatim> <f:selectitems value="#{myclass.listmyfee}"/> </f:verbatim> </p:selectoneradio> @name("myclass") public class myclass { private string fee; private map<string, string> listmyfee; public myclass(){ //constructor listmyfee = new linkedhashmap<string, string>(); listmyfee;.put("yes", "yes"); listmyfee;.put("no", "no"); } public map<string, string> getlistmyfee() { return this.listmyfee; } , set fee written
your bean-code wrong, need f:selectitems
list of list<selectitem>
.
it this:
list<selectitem> list = new linkedlist<selectitem>(); list.add(new selectitem(<returnvalue>, <displayvalue>));
in xhtml-file:
<p:selectoneradio id="firstbill" value="#{myclass.myfee}" label="what do?"> <f:selectitems value="#{myclass.list}" /> </p:selectoneradio>
Comments
Post a Comment