5 Replies Latest reply on Feb 20, 2009 3:44 PM by kukeltje.ronald.jbpm.org

    Dynamic Dropdown

    mikiel11

      I'm new to Seam and Richfaces and need help on populating dropdown from oracle database,instructions and sample code if available will be very helpful,I've been trying it for two weeks now

        • 1. Re: Dynamic Dropdown
          jkronegg

          Have a look to the RichFaces suggestionBox

          • 2. Re: Dynamic Dropdown
            mikiel11

            any dynamic dropdown from database sample?

            • 3. Re: Dynamic Dropdown
              jkronegg

              RichFaces will not do it for you ;-) You need to implement it yourself

              • 4. Re: Dynamic Dropdown
                mikiel11

                any example if any?

                • 5. Re: Dynamic Dropdown
                  kukeltje.ronald.jbpm.org

                  Hmmmmm weeks? I used google with some good search terms and found an example within 10 minutes.... (but don't tell your boss))


                  Use this as a binding to the SelectItems component in your page


                  private UISelectItems getMyItems() {
                  
                    Application application = FacesContext.getCurrentInstance().getViewRoot().findComponent();
                    UISelectItems selectItems = (UISelectItems)application.createComponent(UISelectItems.COMPONENT_TYPE);
                    ArrayList options = new ArrayList();
                    options.add(new SelectItem("Label1", "Value1"));
                    options.add(new SelectItem("Label2", "Value2"));
                    options.add(new SelectItem("Label3", "Value3"));
                    selectItems.setValue(options);
                    return selectItems;    
                  }  



                  I think you can fit in your database access yourself