Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Michael Oberleitner
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim,

i tried it now with



but it behaves the same as

 
Michael Oberleitner
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And this behavior is just in firefox, in chrome all is fine rendered without additional click.
 
Tim Holloway
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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: 34
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried this now



but still the same  :banghead:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!