This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JSF datatable rendering problem with ajax

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

You may find interesting to look at my post about f:ajax at https://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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Volodymyr Levytskyi wrote:Hello!

You may find interesting to look at my post about f:ajax at https://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.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic