3 Replies Latest reply on Nov 17, 2007 3:14 PM by Pete Muir

    how to do indexed/map-backed fields in seam?

    Mike Kohout Newbie

      I've got a datatable that iterates over the results of a fairly expensive search.
      For each row, the user can perform an action on the entity for that row of the table depending on the value of a selectOneMenu.

      Since each row needs to have it's own "operation" field, I've tried to implement this using a Map-backed field(with the user's id as the key). For some reason this isn't working. On selection, nothing is placed in the Map and no exceptions are being thrown.

      here's the bit of facelet:

      <rich:dataTable id="memberSelectList" value="#{viewStudyAction.userSearchList}" >
       <h:selectOneMenu value="#{viewStudyAction.userRole[possibleMember.umnDID]}">
       <s:selectItems value="#{viewStudyAction.getAllStudyRoles()}" var="role" label="#{role.name}"/>
       <a4j:support event="onchange" reRender="memberGrid" ajaxSingle="true"/>

      here's the bit of the named component:
      @Name(value = "viewStudyAction")
      @Scope(value = ScopeType.CONVERSATION)
      public class ViewStudyAction {
       HashMap userRole =new HashMap();
       public List<StudyRole> getAllStudyRoles()
       return studyRoleHome.getAllRoles();

      any suggestions, explicitives, or rants would be welcome
      Mike Kohout