1 Reply Latest reply on Feb 7, 2008 1:20 PM by fischman_98

    Datatable Binding Affecting Display upon Navigaion

    fischman_98

      I have a <t:dataTable> that is bound to rows data and <t:columns> bound to column data (I did it this way to allow for dynamic columns - in this case 3x3). I have a navigation rule from page 1 to page 2. The datatable's on each page bind to the same backing bean property.

      Page 1 is displaying links, when clicked go to Page 2. The problem is the data displayed on Page 1 is ALSO being displayed on Page 2 in addition to the page 2 data. I simplified the code to not retrieve any data from the backing bean...simply outputting an X link on Page 1 and Y on Page 2.

      So Page 1 displays:
      X X X
      X X X
      X X X

      and Page 2 displays:
      YX YX YX
      YX YX YX
      YX YX YX

      I also had to put an id tag on Page 2 t:outputText. Page 2 should obviously only display Y.

      Any thoughts?

      Here's the code:

      Page 1:

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      
      <html>
      <head>
      <title></title>
      </head>
      <body>
      <f:view>
       <h:form style="margin: 0 auto; padding: 0; width: 521px;">
       <t:dataTable var="testrows" value="#{exploreBean.dataModel}"
       rows="#{exploreBean.rowsPerPage}"
       binding="#{exploreBean.rowsData}">
      
       <t:columns value="#{exploreBean.columns}" var="testcols"
       binding="#{exploreBean.columnsData}">
       <t:commandLink action="success">
       <t:outputText value="X" />
       </t:commandLink>
       </t:columns>
      
       </t:dataTable>
       </h:form>
      
      </f:view>
      </body>
      </html>

      Page 2:
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      
      <html>
      <head>
      <title></title>
      </head>
      <body>
      <f:view>
       <t:outputText value="Test 2"></t:outputText>
      
       <h:form style="margin: 0 auto; padding: 0; width: 521px;">
      
       <t:dataTable var="yrows" value="#{exploreBean.dataModel}"
       rows="#{exploreBean.rowsPerPage}"
       binding="#{exploreBean.rowsData}">
      
       <t:columns value="#{exploreBean.columns}" var="cols"
       binding="#{exploreBean.columnsData}">
       <t:outputText id="y" value="Y" />
       </t:columns>
      
       </t:dataTable>
       </h:form>
      
      </f:view>
      </body>
      </html>


      [/img]

        • 1. Re: Datatable Binding Affecting Display upon Navigaion
          fischman_98

          I want to add I am using:
          MyFaces 1.1.5
          Tomahawk 1.1.6
          RichFaces 3.1.4.GA

          The exploreBean the dataTable is binding to is requestScoped.

          The navigation rule is redirect: no.

          My (educated?) guess, is there is some issue with the rebuilding of the page due to id's, etc. (I got the duplicate id error when I had no id's assigned)

          If I do a redirect: yes - no problem.

          Might have to post in jira....any thoughts?