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

Display just a datatable is a faces request?

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27762
196
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
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".
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
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
Indeed. Here's a good map of the lifecycle. Assume undocumented deviations at your peril:



developersbook.com JSF Lifecycle
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic