3 Replies Latest reply on Aug 6, 2009 1:46 AM by panky_p

    Need help on selectOneMenu

    romadatta

      I am looking forward to implement a Others option with one of the selectOneMenu list. This list is populated from the database. I want to have a "Others" option here, using a4j:support, when clicked a textbox should be rendered and drop-menu should be disabled at the same time. Anyone please suggest.

        • 1. Re: Need help on selectOneMenu
          panky_p

          Is "Other" option in selectOneMenu list coming from database?

          <h:selectOneMenu value="#{myBean.selectedVal}" disabled="#{myBean.selectedVal == "Other"}">
           <f:selectItems value="#{myBean.selectionList}" />
           <a4j:support event="onchange" reRender="myForm" /> //try container here instead of rendering form
          </h:selectOneMenu>
          <f:subview rendered="#{myBean.selectedVal == "Other"}"> //Check for String "Other" or whatever option name you have
           <h:inputText value="#{myBean.inpValue}"/>
          </f:subview>

          In my case it is working solution as the "Other" option is in selectOneMenu list.

          • 2. Re: Need help on selectOneMenu
            romadatta

            Hi,
            Thanks for the reply. But i was wondering, as the Other option is not the part of database.

            • 3. Re: Need help on selectOneMenu
              panky_p

              ok, then I think you will need to add Other option value to your selectOneMenu list explicitly.