Forums Register Login

Display just a datatable is a faces request?

+Pie Number of slices to send: Send
Hy,

1. If we have and xhtml page and we just have a datatable to show some records through a managed bean, I think there is no validation phase, apply request values phase... so it would be a faces request but not with the lifecycle of a jsf request, right?

2. In the previous case because the normal phases of a jsf request are not going to be called, the method that will be called in the backing bean to get the records, could be called more than once although its not a normal faces request?

Thanks
+Pie Number of slices to send: Send
The JSF lifecycle is not that variable. If you submit a form, it will go through validation phase, even if there is no data in the form. However, only submitted data ever gets validated, regardless.

Don't assume you know how many times the property get and set methods will be invoked. Period. Regardless of whether there's form data or not. It's not guaranteed to be a fixed constant, and even if it appears to be so today, it may not be so tomorrow. To say nothing of how easy it would be to break something when someone comes in later and makes "just one small change".
+Pie Number of slices to send: Send
you can use the "immediate" attribute to bypass your process validations and update model phases, but it can be kind of iffy, especially if you do have information to pass to the page you need. I would recommend not tampering too much with JSF internals. Unless you get validation-specific errors, or you see it's a performance bottleneck at that location, I wouldn't use it.
+Pie Number of slices to send: Send
Indeed. Here's a good map of the lifecycle. Assume undocumented deviations at your peril:



developersbook.com JSF Lifecycle
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 927 times.
Similar Threads
getters and setters in JSF
Datatable Question
how to disable datascroller in jsf when the datatable doesn't have any records
Need to understand the Request Scope
Memory Leak issue
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:10:45.