Hello,
I'm trying to use Row Selection in DataTable. I want to display data from row in a dialog, (almost) exactly as in this example: DataTable - Row Selection. Everything is working, but there is a problem. I supposed that there is some problem in my code, so I ran code from this example and there is the same problem. I'll talk about this example, now.
Data for DataTable are obtained by calling method getCars().
When somebody clicks on any button in generated DataTable, method getCars() from TableBean is called 13 times. (If I have 10 records in DataTable, method is called 13 times. If I have 20 records, method is called 13 times too.)
How can I change this behavior? I only want to set selectedCar and display it in a dialog.
I don't know, if it isn't a bug in Primefaces, because it's weird behavior, but i hope, that's only some settings are somewhere missing.
I'm using MyEclipse 9.1, Mojaara JSF 2.1.2, Jetty 7.1.6, Java 1.6.0_24, Firefox 7.0.1, Opera 11.51; tried on Primefaces 3.0 M2 and 3.0 M3.
Thanks.
AJAX request in DataTable reloads whole DataTable 13x
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
value="" should only be a value expression. In JSF you should not write logic into your getter.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
I want to renew data on page from database on each refresh, so getter calls application layer which provides new data.
I understand, getter should return value, nothing else, but how can I renew data when page reloads?
Anyway, but why is getter called so many times?
I understand, getter should return value, nothing else, but how can I renew data when page reloads?
Anyway, but why is getter called so many times?
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
you could use f:event with prerenderview.
The listener of this event could load your data on every request.
The listener of this event could load your data on every request.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- Information
-
Who is online
Users browsing this forum: No registered users and 48 guests