[jboss-user] [JBoss Seam] - how to do indexed/map-backed fields in seam?

mwkohout do-not-reply at jboss.com
Thu Nov 15 15:12:46 EST 2007


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}" >
  | <rich:column>
  |    <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"/>
  |    </h:selectOneMenu>
  | </rich:column>
  | </rich:dataTable>
  | 

here's the bit of the named component:

  | @Name(value = "viewStudyAction")
  | @Scope(value = ScopeType.CONVERSATION)
  | @AutoCreate
  | public class ViewStudyAction {
  |    HashMap userRole =new HashMap();
  |     public List<StudyRole> getAllStudyRoles()
  |     {
  |         return studyRoleHome.getAllRoles();
  |     }
  | 

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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105206#4105206

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105206



More information about the jboss-user mailing list