1 Reply Latest reply on Aug 14, 2006 1:27 PM by Pete Muir

    selectItems and DataModel

    David Mor Newbie

      Hey,

      I am trying to use the @selectItems annotation,

      I have the following stateless bean

       @DataModel
       private List<Customer> customerList;
      
       @DataModelSelection
       @Out(required=false)
       private Customer selectedCustomer;
      
       @SelectItems(strategy = Strategy.OBJECT, label = "name")
       private List<Customer> customerListForSelectbox;
      



      I understand that it is not possible to combine the DataModel with SelectItems since @SelectItems annotation create 'SelectItem' objects which fits the JSF selectItems components, but at the moment I try to add another List (the 'customerListForSelectbox' list) with the @SelectItems annotation, in deployment time I get the following error:


      sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.IllegalStateException: Missing value() for @DataModelSelection with multiple @DataModels
       at org.jboss.seam.Component.initMembers(Component.java:526)
      



      So how can I combine @DataModel and @SelectItems annotations together?


      Thanks a lot,
      David