Try using two different forms…

You only have one <form> tag with both dataTables nested inside it…

 

Dominik


From: Mak NF [mailto:[EMAIL PROTECTED]
Sent: Monday, September 11, 2006 18:03
To: [email protected]
Subject: Problem with using multiple dataTables in a JSP page

 

Hi,

'

I am experiencing problems in using mutliple dataTables in a single JSP page. I have two dataTables in my simplified JSP page as follows:

 

<f:view>

<h:form>

 

<t:commandButton value-"ADD" action="" color=red>"#{backingBean.add_to_table1}" />

 

<t:dataTable id="table1" value="#{backingBean.list1}" >

   <t:column>

      ....

   </t:column>  

   <t:column>

      ....

   </t:column>  

</t:dataTable>

 

<t:dataTable id="table2" value="#{backingBean.list2}" >

   <t:column>

      ....

   </t:column>  

   <t:column>

      ....

   </t:column>  

</t:dataTable>

 

</h:form>

</f:view>

 

When i click the "ADD" button, it will add a new row into table 1. This works fine and table 1 displays an additional row of record but "extra" duplicated columns will appear in table 2. The record count in table 2 remains the same but somehow the columns got duplicated.

 

I read that myfaces dataTable does not render an "id" attribute if we specify one, so could this be the cause of my problem as i am using two dataTables in one form? 

 

Has anyone had this problem and got a workaround for it? Can someone shed some light on this? Is it a JSF bug or my own coding bug? Thanks in advance.

 

 

Reply via email to