This content has been marked as final.
Show 4 replies
-
1. Re: h:selectManyCheckbox for ManyToMany relationship
yuriy_zubarev Oct 17, 2007 4:32 PM (in response to yuriy_zubarev)I also tried Tomahawk but the persistence still doesn't work:
<h:form id="roleForm"> <h:inputText value="#{role.name}"/> <t:selectManyCheckbox value="#{role.permissions}" layout="spread" id="perms"> </t:selectManyCheckbox> <h:dataTable value="#{modules.resultList}" var="m"> <h:column> #{m.name} module <h:dataTable value="#{m.permissions}" var="dtp"> <h:column> <t:checkbox for="perms" index="#{dtp.index}"/> </h:column> </h:dataTable> </h:column> </h:dataTable> <h:commandLink action="#{roleHome.persist}" value="Save"/> </h:form>
Regards,
Yuriy -
2. Re: h:selectManyCheckbox for ManyToMany relationship
yuriy_zubarev Oct 17, 2007 6:41 PM (in response to yuriy_zubarev)This is from documentation of selectManyCheckbox: If any of the children are
an instance of SelectItemGroup, render them as a nested table.
Any easy way to create List of SelectItemGroup instances from a list of entity objects in Seam?
Thank you,
Yuriy -
3. Re: h:selectManyCheckbox for ManyToMany relationship
pmuir Oct 23, 2007 11:43 AM (in response to yuriy_zubarev)Each row of your datatable (and so group of checkboxes) refers to the same backing list so will overwrite it.
As for grouping, no, currently there is no easy way to use groups with s:selectItems (actually there is no easy way to use grouping with JSF at all that I can see). I filed a feature request, and I'll try to implement it soon.
In the meantime, your best bet is to return selectitemsgroups using f:selectItems (old-style JSF).