• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF datatable rendering problem with ajax

 
Denis Sysoev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have datatable with "delete" button in each row. When clicked, method should remove object from List and database, and after, I want to re-render datatable. After clicking "delete" all what I have expected working fine, except of re-rendering datatable. To see changes I need explicitly refresh page, so without Ajax its working perfectly.
JSF Table:

Bean method:

Im find a lot in Google same problems, but still no luck with fixing this, please point me whats wrong. Thanks in advance.
 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

You may find interesting to look at my post about f:ajax at http://www.coderanch.com/t/594176/JSF/java/dynamic-div-reset#2708812
Try this f:ajax
<f:ajax execute='transactions' event='click' render="transactions"/>
 
Denis Sysoev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Volodymyr Levytskyi wrote:Hello!

You may find interesting to look at my post about f:ajax at http://www.coderanch.com/t/594176/JSF/java/dynamic-div-reset#2708812

Thanks but I have read this post before I post this one.
Volodymyr Levytskyi wrote:
Try this f:ajax
<f:ajax execute='transactions' event='click' render="transactions"/>

The same reaction. With event='click', its even didn't call my method.
 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

Sorry, probably it is not needed to execute the whole table on event 'click' but only commandbutton
<f:ajax execute='@this' event='click' render="transactions"/>

Also h:commandButton should be inside h:form
 
Denis Sysoev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Volodymyr Levytskyi wrote:Hello!

Sorry, probably it is not needed to execute the whole table on event 'click' but only commandbutton
<f:ajax execute='@this' event='click' render="transactions"/>

Also h:commandButton should be inside h:form

Its not working for me, and yes it was inside form.

I have solve my problem by adding wrapper for datatable and re-render it. Something like this:

Thank You for your help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic