3 Replies Latest reply on May 5, 2010 4:37 AM by ilya_shaikovsky

    inputText not rendered inside selectOneMenu

    jacinh

      Hi,

       

      I have searched other discussions on the forum but can't seem to find a workng solution.

       

      I am trying to render additional input text fields based on the selection from a selectOneMenu.  However, the value I enter into the inputText field is not being submitted (setter not called).   For example, when i select option b, and enter value into value2 input field, it doesn't seem to think the field is rendered, eventhough it's rendered on screen.

       

       

      My code:

      <h:panelGrid>
            <a4j:form id="block">
              <a4j:region>
                <h:selectOneMenu value="#{testBean.option}" immediate="true">
                  <f:selectItem itemValue="a" />
                  <f:selectItem itemValue="b" />
                  <f:selectItem itemValue="c" />
                  <a4j:support event="onchange" reRender="block"
                    ajaxSingle="true" />
                </h:selectOneMenu>
              </a4j:region>
              <h:outputText value="block A " rendered="#{testBean.option=='a'}" />
              <h:inputText value="#{testBean.value1}" id="value1"
                rendered="#{testBean.option=='a'}"></h:inputText>
              <h:outputText value="block B " rendered="#{testBean.option=='b'}" />
              <h:inputText value="#{testBean.value2}" id="value2"
                rendered="#{testBean.option=='b'}"></h:inputText>
              <h:outputText value="block C " rendered="#{testBean.option=='c'}" />
              <h:inputText value="#{testBean.value3}" id="value3"
                rendered="#{testBean.option=='c'}"></h:inputText>
              <a4j:commandButton styleClass="" value="Submit"
                action="#{testBean.save}" />
            </a4j:form>
          </h:panelGrid>

       

      Any input apprediated!!