• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

no automatical rerender of columns in p:dataTable after ajax call

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I have a p:dataTable with 3 columns and one of the columns is editable. When the user edits this column some calculations happen and the value of  another column and a field in the footer should change.
This all functions except that column b does only get rerendered after clicking in the window or changing the tab, not automatically.



In line 26 there is the inputcomponent to change the quantity and in the setter of the quantity actions get triggered to change totalsum and modelPriceInput
I guess that the values are in the table, but the rendering only starts after a click anywhere on the page.
I have also tried



instead, but this does not change the footer at all, even after a click on the page.
I want this rendering without additional user input. Maybe someone knows what to do here!

regards, michael
 
Saloon Keeper
Posts: 28324
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try re-rendering the entire articleTable. Sometimes fine-grained re-rendering doesn't work because either the actual ID you need on the component isn't what your think it is (due to relative ID paths) or in some cases, the underlying HTML doesn't allow for such detailed updating.
 
Michael Oberleitner
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim,

i tried it now with



but it behaves the same as

 
Michael Oberleitner
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And this behavior is just in firefox, in chrome all is fine rendered without additional click.
 
Tim Holloway
Saloon Keeper
Posts: 28324
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say that re-rendering at the table level is the same as re-rendering as the form level do you mean that both levels work or that both levels do not work?

I haven't done AJAX with PrimeFaces, but usually you have to have some way to attach the AJAX action to a specific control event. I think, for example, that the control update event may not get fired until you explicitly submit the form. Usually you'd tie the AJAX to something like the control's blur event.
 
Michael Oberleitner
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both attempts with



and


work just on chrome and internet explorer. On firefox it's just the same that the user has to click in the page to trigger the changes to the calculated fields get visible.

Now I try to solve the isssue with a ValueChangeListener on pe:inputNumber but I'm not sure if this will work.
 
Tim Holloway
Saloon Keeper
Posts: 28324
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A valueChangeListener is not AJAX-driven nor is it related to any of the JavaScript events. A valueChangeListener fires when a form is submitted AND the associated control data value changed. It does not initiate a submit on its own.

The "blur" event is a JavaScript (client-side) event that fires when you exit the control and move the input focus somewhere else. It's the most common tracker for controls that don't monitor for keystroke events, since a JavaScript update event can capture intermediate invalid values. And, yes, I think the "update" JavaScript event does have a reputation for odd behavior on different platforms.

 
Michael Oberleitner
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this now



but still the same  :banghead:
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic