[jboss-user] [JBoss Seam] - <f:selectItems> tag => exception when filled by getResultLis

olvin do-not-reply at jboss.com
Wed Nov 7 08:19:24 EST 2007


Hello,

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 ???

Thanks,

Olv

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102528#4102528

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102528



More information about the jboss-user mailing list