Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Action on datatable row is executed on different row if table data is modifed in background  RSS feed

Miro Ricco
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a datatable displaying the items which are added or removed in the background dynamically.

There is an action which can be started related to selected row. The action is started by the command button in a separate column and I have tried more ways to relate the action to the item ID by adding f:param or f:attribute into the command button component. I have also tried to set the value of command button to the ID and getting the value from inside the action listener's method.
All methods work in the case the data in the table is not modified in the background.
But if new data is inserted or removed from the table, clicking the command always starts the action for different row - the row which would be on the place of click if I refresh the table before the click.

This is strange and I can't find what I'm doing wrong and how to avoid it.

I use JSF RI + IceFaces 1.8.2 and the application is deployed on Tomcat 5.5 running Java 6.
The page with data table is refreshed automatically by AJAX on demand renderer. The on demand renderer is requested for re-render each time the data in the table is modified - but it is limited to send re-render request once per 10 seconds only.

Do you happen to recognize the pitfall i'm trapped in?

Kind regards
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!