This content has been marked as final.
Show 5 replies
-
1. Re: h:SelectManyListbox, s:SelectItems and Many-to-Many mapp
pmuir Feb 4, 2008 6:44 PM (in response to ovistanciu)Yes, you are right, you have to back a selectMany with a list or an array.
-
2. Re: h:SelectManyListbox, s:SelectItems and Many-to-Many mapp
ovistanciu Feb 5, 2008 3:23 AM (in response to ovistanciu)Pete, I tried your example posted here: http://jroller.com/pmuir/entry/using_sets_in_jsf.
userGroup.xhtml now looks like this:<h:selectManyListbox id="locationsListBox" value="#{dc:asList(userGroupHome.instance.locations)}" disabled="#{not s:hasRole('admin')}"> <s:convertEntity /> <s:selectItems value="#{locationList.resultList}" var="location" label="#{location.locationName}" noSelectionLabel="None" /> </h:selectManyListbox>
where 'asList' is the function described in the link above.
Now, when trying to create a userGroup I get:model validation failed:/members/userGroup.xhtml @33,44 value="#{dc:asList(userGroupHome.instance.locations)}": Illegal Syntax for Set Operation
What am I missing? -
3. Re: h:SelectManyListbox, s:SelectItems and Many-to-Many mapp
pmuir Feb 5, 2008 5:52 PM (in response to ovistanciu)Is there a stack trace for that?
-
4. Re: h:SelectManyListbox, s:SelectItems and Many-to-Many mapp
ovistanciu Feb 6, 2008 3:10 AM (in response to ovistanciu)No, there isn't. Just the faces message posted above (model validation failed).
-
5. Re: h:SelectManyListbox, s:SelectItems and Many-to-Many mapp
stephendv Feb 6, 2008 4:34 AM (in response to ovistanciu)I'm had similar problems getting this to work - eventually solved it, code is here: http://www.twisteddelight.org/downloads/contactn.tar.gz
Recipients have a many to many relationship with Profiles. I used a selectManyCheckbox to allow recipients to assign themselves to profiles.
AFAIK, selectManyListBox would be identical.