2 Replies Latest reply on Nov 15, 2007 11:33 AM by Olivier Vincent

    <f:selectItems> tag => exception when filled by getResultLis

    Olivier Vincent Newbie


      If I fill a <f:selectItems> tag directly with getResultList(), I have this exception :

      Argument Error: An option for component roadMapTypes was not an instance of javax.faces.model.SelectItem. Type found: java.util.ArrayList.

      But when I put the results list in a new list with SelectItem objects before returning the results list, I have no exception... :
      public Collection getRoadMapTypeList()
       List returnValues = new ArrayList();
       String sql = "SELECT glos.value" +
       " FROM Glos glos" +
       " WHERE glos.glos_resume != '00000'" +
       " AND glos.glos_type = #{glos_roadmapsal_type}";
       List rmtList = super.getEntityManager().createQuery(sql).getResultList();
       for (Iterator itList = rmtList.iterator(); itList.hasNext();)
       String value = (String) itList.next();
       returnValues.add(new SelectItem(value));
       return returnValues;

      Is it a bug in Seam or in JSF ???