5 Replies Latest reply on Aug 26, 2008 2:23 PM by maumau

    Problems with richfaces combobox

    amayen
      Hi,

      I want to show a combo box that is populated by a method that returns a list.

      On the view side I have the following:

      <h:selectOneMenu id="hospitalSelect" value="#{donator.hospital}" tabindex="4" required="true">
           <s:selectItems value="#{hospitals}" var="h" label="#{h.name}" itemValue="#{h}" noSelectionLabel="Bitte auswählen..." hideNoSelectionLabel="true"/>
           <s:convertEntity/>
      </h:selectOneMenu>


      This works fine!

      If I want to do the same via the richfaces comboBox (rich:comboBox) it does not work fine anymore:

      <rich:comboBox value="#{donator.hospital}" tabindex="4" required="true">
           <s:selectItems value="#{hospitals}" var="h" label="#{h.name}" noSelectionLabel="Bitte auswählen..."/>
           <s:convertEntity/>
      </rich:comboBox>


      It only shows numbers as the value for the combobox items.
      Am I missing something or might this be a bug and if it is does it come from
      richfaces or seam?


      Thanks!
        • 1. Re: Problems with richfaces combobox
          amayen

          I am using Seam 2.0.2.SP1
          and the richfaces version that came bundled with it.
          I even tried some other richfaces versions with no success
          (3.2.1.GA,3.2.2.BETA2)

          • 2. Re: Problems with richfaces combobox
            accless

            Are the shown numbers the ids of your entity? the rich face api needs to know what value to fetch in the combobox. By default it uses the ID, as far as i remember. Hope this helps a bit...

            • 3. Re: Problems with richfaces combobox
              amayen

              Yes it uses the Id's of the entities when I use it without s:convertEntity when I use s:convertEntity the value of the toString() method is shown.


              I'm assuming that the s:selectItems tag is not compatible with the rich:combobox, at least not in the versions I tried.


              Does someone have a working example and the version numbers of seam and richfaces would also be interesting.



              Thanks

              • 4. Re: Problems with richfaces combobox
                cosmo

                I also had the same issue with the rich:combobox, which seems to ignore the label attribute within the s:selectItems if the s:convertEntity is present. Regarding the numbers in the combobox, you can modify this behaviour following this example http://in.relation.to/8630.lace or use another rich faces component with a similar behaviour (ie rich:suggestionbox).

                • 5. Re: Problems with richfaces combobox
                  maumau
                  Hi all,

                  Had the same problem and posted it in the richfaces forum.
                  http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172548#4172548

                  Bug https://jira.jboss.org/jira/browse/RF-4293 was posted in JIRA.

                  Sincerely

                  Malte Wiskott