2 Replies Latest reply on Jun 19, 2008 12:40 PM by Ziphyre Marco

    Problem in JavaBeans as a backing bean?

    Ziphyre Marco Newbie

      Hi,


      The following code give me an empty table, while removing the @Name annotation and placing managed-bean lines in faces-config.xml does the work. From what I have read in the Seam doc, JavaBeans can be used as backing beans. So I obviously getting something wrong.


      .xhtml:


      <h:dataTable value="#{plannerEvents.eventList}" var="event">
              <h:column>
                      <h:outputText value="#{event.name}"/>
              </h:column>
      </h:dataTable>



      JavaBean:


      import java.util.List;
      
      @Name("plannerEvents")
      public class PlannerEventsBean {
         private List<Integer> eventList;
      
         public PlannerEventsBean() {
            eventList = new ArrayList<Integer>();
            eventList.add(3);
            eventList.add(6);
            eventList.add(2);
         }
      
         public List<Event> getEventList() {
            return eventList;
         }
         public void setEventList(List<Event> eventList) {
            this.eventList = eventList;
         }
      }



      If I remove the @Name annotation and add managed-bean definition to faces-config.xml, it works...