4 Replies Latest reply on Dec 5, 2006 10:02 AM by pmuir

    <si:selectItems ...>

    toni

      Hi,

      I read the wiki on how to use the <si:selectItems> several times, looked at the examples, but I still run into the following excepiton:

      javax.faces.FacesException: value must be iteratable

      But I'm returning a List, which is iteratable. I'm using JBoss 4.04GA, with Seam 1.0.1 GA and 1.1.1beta2 of selectItems.

      Does somebody see anything wrong with code here:

      The function to build the List:
      ----------------------------------------

      @SuppressWarnings("unchecked")
      @Factory("clients")
      public List buildClients()
      {
      List client = entityManager.createQuery("from Client").getResultList();
      return client;
      }

      The JSP snippet, which causes the exception
      ---------------------------------------------------

      <h:selectOneMenu value="#{clientsActionBean.client}" required="false">
      <si:selectItems value="#{clients}" var="c" label="#{c.name}" noSelectionLabel="Please Select..."/>
      </h:selectOneMenu>

        • 1. Re: <si:selectItems ...>
          pmuir

          Can you use your debugger and check what the variable originalValue refers to on line 213 of org.jboss.seam.selectitems.ui.UISeamSelectItems

          The only reason that exception should occur is that originalValue does not implement Iterable (which List does).

          Also, try using List not List as the return type.

          • 2. Re: <si:selectItems ...>
            pmuir

            oops

            try using

            List<E>


            as the return type

            • 3. Re: <si:selectItems ...>
              toni

              I did all this. It's an ArrayList and I tried using List and other things. It's not working and I guess another bug. Oh, well...

              • 4. Re: <si:selectItems ...>
                pmuir

                Well if it is a bug I would like to fix it. Did you debug UISeamSelectItems? What was the value of originalValue?

                Thanks