11 Replies Latest reply on Dec 17, 2009 11:00 AM by denebj

    Submit a form with rendered component

    denebj

      Hello guys,

      I have a small issue, I have a form with some components that are rendered on the fly. My issue is that when I submit my form these rendered values are not set in my bean :-/
      And I checked on the server side, the values are good in the RequestParameterMap.

      Here the code :

      
      <h:form >
      <h:outputLabel value="Reference Number :" for="StdReference" />
       <h:inputText id="StdReference"
       label="Reference Number"
       value="#{request.Id}"
       size="5"
       maxlength="20"
       readonly="true"/>
      
      <a4j:outputPanel ajaxRendered="true">
       <h:selectOneMenu
       id="statusChoice_1"
       rendered="#{request.defaultChoice}"
       value="#{request.statusInString}" >
       <f:selectItems value="#{request.srStatusCollection_1}" />
       </h:selectOneMenu>
      
       <h:inputText
       id="PriceSR"
       rendered="#{request.pending}"
       label="Price"
       value="#{request.price}"
       size="10" maxlength="10">
      
       <f:convertNumber
       type="currency"
       currencyCode="USD"
       maxFractionDigits="2"
       currencySymbol="$" />
       </h:inputText>
      
      
       <a4j:commandButton
       id="applyChange"
       value="Apply changes"
       type="submit"
       action="#{request.updateRequest}" >
       <a4j:actionparam
       name="ID"
       value="#{request.Id}"
       assignTo="#{request.Id}"/>
       <a4j:actionparam
       name="Price"
       value="#{request.price}"
       assignTo="#{request.price}"/>
       <a4j:actionparam
       name="status"
       value="#{request.statusInString}"
       assignTo="#{request.statusInString}"/>
       </a4j:commandButton>
      
      </h:form>
      
      


      If I input an value in the <a4j:actionparam name="Price" > (like value="10") and the <a4j:actionparam name="status">, the values are in my bean when I submit the form (and I have no issue with the <a4j:actionparam name="ID" >).
      I think I have an issue because of the fact that the components are rendered dynamically and it is not in the JSF tree maybe ?.
      I am pretty sure it is a little thing that I missed but I do not know what :-/
      My bean is in request mode.

      Thanks for your help !