0 Replies Latest reply on Jun 7, 2006 6:30 AM by Christian Fein

    Strange things happends to my datatable

    Christian Fein Newbie

      f got an datatable:

      When i visit the page, everything works fine. I get 2 different board links with 2 different ids.

      ID NAME Commands
      10 neuboard
      11 testboard

      after clicking on: the testboard link i get:
      ID NAME Commands
      11 testboard
      11 testboard

      I checked the datamodel. This is correct. even on the 2. call. So JSF mixed it up. The c:forEach output displays both times the correct data (neuboard,testboard).
      i really dont understand what i am doing wrong.

      Used MyFaces 1.1.3

      thanks for help.

      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
       <ui:composition template="/templates/emptyone.jsp">
       <ui:define name="content">
       <h:dataTable id="table1" border="1" var="board" value="#{boardList}" >
       <h:column id="col1">
       <f:facet name="header">
       <h:outputText value="ID" />
       <h:outputText value="#{board.id}" />
       <h:column id="col2">
       <f:facet name="header">
       <h:outputText value="NAME" />
       <h:commandLink value="#{board.name}" action="#{boardManager.select}"/>
       <h:column id="col3" >
       <f:facet name="header">
       <h:outputText value="Commands" />
       <h:commandButton value="Edit" action="#{boardManager.edit}" />
       <h:commandButton value="Delete" action="#{boardManager.delete}" />
       <c:forEach items="#{boardManager.boards}" var="b" >
       #{b.name} <br />

      public class BoardManagerBean implements BoardManagerLocal,Serializable {
       @EJB BoardFacadeRemote facadeRemote;
       private Board board;
       List<Board> boardList;
       List<Category> categories;
       public String saveBoard() {
       for(Board b : boardList) {
       return "success";
       public void select() {
       public void findBoards() {
       boardList = facadeRemote.getAllBoards();
       public void findCateogries() {
       if(board==null) {
       categories= new ArrayList<Category>();
       } else {
       categories = board.getSubCategories();
       public void delete() {
       // TODO Auto-generated method stub
       public void edit() {
       // TODO Auto-generated method stub
       public List<Board> getBoards() {
       return boardList;
       @Remove @Destroy
       public void destroy() {}