0 Replies Latest reply on Mar 7, 2013 3:37 AM by Kenneth Njendu

    accessing form fields in seam

    Kenneth Njendu Newbie

      In the application I'm developing I have a fairly complex view that requires me to use HTML elements to render items returned from the backing bean. As such, on submission of the form I need to able to access the form fields from the request. Unfortunately I can't find them in request. I'm using JSF 1.2, SEAM 2.3. This is the view html;

       

       

      <select id="role_select_#{treeCount.index}_#{locationCount.index}_#{departmentCount.index}" multiple="multiple" size="#{userManagementAction.roleList.size}">
          <c:forEach var="role" items="${userManagementAction.roleList}">
              <c:choose>
                  <c:when test="${userManagementAction.selectedRole(deptItem,role)}">
                      <option value="#{treeItem.root.data.id}_#{locationItem.data.id}_#{deptItem.data.id}_#{role.id}" selected="selected">#{role.name}</option>
                  </c:when>
                  <c:otherwise>
                      <option value="#{treeItem.root.data.id}_#{locationItem.data.id}_#{deptItem.data.id}_#{role.id}">#{role.name}</option>
                  </c:otherwise>
              </c:choose>
          </c:forEach>
      </select>
      

       

      I am able to inject the request using seam conventions. When I interrogate the request and session objects I find the following (ignore the # they are there so that I can find debug statements quickly in the logs);

       

       

      ###### PARAMETER NAME userManagementForm:saveChangesButton 
      ###### PARAMETER VALUE Save Changes 
      ###### PARAMETER NAME userManagementForm 
      ###### PARAMETER VALUE userManagementForm 
      ###### PARAMETER NAME javax.faces.ViewState 
      ###### PARAMETER VALUE j_id3 
      ###### ATTRIBUTE NAME com.sun.faces.util.RequestStateManager 
      ###### ATTRIBUTE NAME org.jboss.seam.core.manager 
      ###### ATTRIBUTE NAME org.jboss.seam.faces.validation 
      ###### ATTRIBUTE NAME org.jboss.seam.web.requestContextPath 
      ###### ATTRIBUTE NAME com.exade.vcp.Filter.ResponseWrapper 
      ###### ATTRIBUTE NAME org.jboss.seam.core.conversationPropagation 
      ###### ATTRIBUTE NAME class org.apache.myfaces.shared_tomahawk.renderkit.html.util.JavascriptUtils.OLD_VIEW_ID 
      ###### ATTRIBUTE NAME org.ajax4jsf.application.AjaxStateManager.AJAX_VIEW_SEQUENCE 
      ###### ATTRIBUTE NAME com.exade.vcp.Filter.done 
      ###### ATTRIBUTE NAME org.jboss.seam.transaction.transaction 
      ###### ATTRIBUTE NAME org.jboss.seam.web.servletContexts 
      ###### ATTRIBUTE NAME org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled 
      ###### ATTRIBUTE NAME org.jboss.seam.core.events 
      ###### ATTRIBUTE NAME org.jboss.seam.web.requestServletPath 
      ###### ATTRIBUTE NAME ajaxContext 
      ###### ATTRIBUTE NAME org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY 
      ####### identity.isLoggedIn() true 
      ####### identity.getPrincipal().getName()User Person 
      ####### credentials.getUsername() null 
      ####### seamSession.isInvalid() false 
      ####### seamSession.isInvalidateOnSchemeChange() false
      
      How do I get the values from the select above in the backing bean?