3 Replies Latest reply on Jul 9, 2008 8:05 PM by Tomáš Tikovský

    s:selectItems ManyToMany relationship

    Bernhard Hurzeler Novice

      Hi there,


      Can anyone tell me why the following snippet does not work.


      
      <h:selectManyListbox id="role" value="#{userHome.instance.roles}" title="Select one or more roles." size="3">
      
         <s:selectItems value="#{roleList.resultList}" var="role" label="#{role.name}" />
      
         <s:convertEntity />
      
      </h:selectManyListbox>
      
      



      There is a ManyToMany relationshop between the user and the role.


      If the user is managed the change in the listbox gets ignored. If the user is unmanaged (new) the selection (first item) returns the following error on create action for user:


      
      Conversion Error setting value '0' for '#userHome.instance.roles}'.
      
      



      Please help. Thanks.