6 Replies Latest reply on May 3, 2007 4:41 PM by ishabalov

    Add item to Dropdown menu

    jonathan.shin

      Is it possible that open the poup window then add new item or update label of current selected item of dropdown menu?

        • 1. Re: Add item to Dropdown menu

          I am lost :-(
          Could you break down your sentence into the small pieces. The step-by-step use case will be fine.

          • 2. Re: Add item to Dropdown menu
            jonathan.shin

            The main contact page has company (object/entity) name drop down and has "add" and "Edit" button next to the company name dropdown. If the company is not yet created, the user will select the "add" button. If user wants to modify the company name, the user will select the "edit" button. When the user select the "add" or "edit" button, it will open the popup window. The use will enter in a compnay name or modify the company name and click "Save" button in the popup window. When the user select the "Save" button in the popup window, the company will then be added or new company name to the drop down in the main contact page.

            • 3. Re: Add item to Dropdown menu

              I still not sure that you speak about DropDown menu, but not about DropDown List. The subject says "Add item to Dropdown menu", but there is no word menu in the description.

              • 4. Re: Add item to Dropdown menu
                jonathan.shin

                Sorry about that. It's dropdown list.

                <h:selectOneMenu id="company" value="#{contactHome.instance.company}">
                 <s:selectItems value="#{companyList.resultList}" var="company"
                 label="#{company.name}" noSelectionLabel="Please Select..."
                 hideNoSelectionLabel="true" />
                 <a4j:support event="onchange" reRender="company, popupCompany, companyInfo1" />
                 <s:convertEntity />
                </h:selectOneMenu>
                


                Thanks.

                • 5. Re: Add item to Dropdown menu

                  Thank you for clarified this point. However, I still do not understand the whole use case.

                  • 6. Re: Add item to Dropdown menu

                    I guess selectOneMenu must be re-rendered after user press "Save" button on the modal window.