Sunday 15 March 2015

jsf 2 - Getting multiple drop down list value from view using JSF 2.0 -



jsf 2 - Getting multiple drop down list value from view using JSF 2.0 -

i trying utilize jsf retrieve multiple drop downwards lists according user input view controller.

however seems cannot find right way.

as drop downwards lists generated dynamically, cannot hard code id / name of drop downwards list.

here code in view:

<ui:repeat var="file" value="#{uploadbean.filesinzip}" varstatus="status"> <tr> <td><h:outputtext value="#{file.name}" /></td> <td> <h:selectonemenu value="#{uploadbean.studentselections}"> <f:selectitems value="#{uploadbean.students}" var="student" itemlabel="#{student.firstname}, #{student.lastname} (#{student.userid})" itemvalue="#{student.id}"/> </h:selectonemenu> </td> </tr> </ui:repeat>

so give hand on it?

you're creating multiple <h:selectonemenu> same value.

what create hashmap<integer, t> of uploadbean.studentselections, each <t> match 1 file in zip.

then can utilize <h:selectonemenu value="#{uploadbean.studentselections[status]}">

you can of course of study reuse uploadbean.students populate each of <f:selectitems>.

jsf-2

No comments:

Post a Comment