5 Replies Latest reply on Mar 19, 2006 11:44 AM by ariska

    Dynamic selectOneMenu

    ariska

      Hi all,

      I'm new to SEAM. I have studied the hotel example and I'm thrilled to try SEAM out in my next project. As database bound comboxes (a dynamic selectOneMenu) are so basic elements in UI design, in case of SEAM, I have been wondering how I can create one with JSF/Seam, where the data to display ([description]) comes from a explicit select statement from one table (say, table_Codes[id, description]]) and the user input is converted accordingly to a key value (id). Any hint would be highly appreciated.

      Best regards,

        • 1. Re: Dynamic selectOneMenu
          gavin.king

          Look at how the dvdstore example handles categories in searchbox.xhtml.

          • 2. Re: Dynamic selectOneMenu
            ariska

            Thanks for your prompt answer.

            I managed to implemented as in the dvd example, though I have one concern left.

            How can I *initialize* the selectOneMenu component with a value?
            Let's say that, in the case of the dvd-store demo, I want the Category to be initialized to "Comedy" .


            kind regards,

            • 3. Re: Dynamic selectOneMenu
              ariska

              I can see how the "Any" value is added, but my point here is to get the value initialized from the database value.

              • 4. Re: Dynamic selectOneMenu
                gavin.king

                The list of categories *is* retrieved from the db (it is not the Any value i am talking about).

                • 5. Re: Dynamic selectOneMenu
                  ariska

                  Sorry, perhaps I did not make my point clear.

                  What I want to accomplish is this:

                  I have a modifyUserForm with the selectOneMenu for the userType [admin,accounting,reporting]. When the form loads the userType selectOneMenu should be initialized and display correct userType value for selected user (for example [accounting] ).


                  kind regards,