Update on DataTable with "rendered" not working

UI Components for JSF
Post Reply
invia79
Posts: 2
Joined: 06 May 2011, 14:52

06 May 2011, 16:04

Hi there,

I've got a very annoying problem since hours. I try to update a datatable that should be conditionally rendered. The update works fine as long as just the the rows display change, i.e. if I remove a row, that table is updated with a row less. But if there are no rows anymore, the table should not be rendered. Instead the table is still displayed with the old data (the last remaining item) and it seems that there is no update at all. If I reload the page, the table is hidden as expected as no data is present and the rendered-condition evaluates to not empty

Code: Select all

<p:dataTable rendered="#{not empty borrowedBooksBean.borrowedCopies}" ...	 
I tracked down the problem and the rendering problem is not linked to the evaluated book list. If I change the change the condition that the table should for example be hidden if there are less than 3 data items, the update works fine up to three. But if the rendered condition evaluates to false, no update is done and I see the 3 data items, although there are only 2 left (which I see if I refresh the whole page).

Also
1. putting the table in an output panel
2. updating the containing form
does not work.

I would appreciate your help very much!

Alex

invia79
Posts: 2
Joined: 06 May 2011, 14:52

09 May 2011, 15:26

Finally I found the solution after endless hours: I put the table to update in

Code: Select all

<h:panelGrid>
and - surprise, surprise - that did the trick.

I hope the learning curve gets steeper !!!!

Alex

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests