Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The getter call during apply request values phase is mandatory because JSF needs to know which input values were initially shown so that it can eventually do any validation and/or call any valuechangelisteners in the next phase where applicable. It is also mandatory to find out which button/link was pressed/clicked in any of the rows so that it knows which bean action to call in the invoke action phase.</p> <p>But if you don't have any input fields which are to be validated/valuechange-checked nor any buttons/links in any of the rows, then I can imagine that the query during apply request values phase is in your eye completely superfluous.</p> <p>Unfortunately, you can't completely disable it. Technically, the only resort to that is putting the data bean in the session scope and do the expensive SQL query (and refresh of datamodel) only in the constructor of the bean and in the bean action method, so that it only get invoked during bean's construction (for 1st view) and during bean's action method (during a new sort/filter/whatever request). The disadvantage is however that any changes in the datamodel are reflected in all windows/tabs the enduser has open in the same session, which might cause "wtf?" experiences for the enduser.</p> <p>Now, Tomahawk was the first which has a nice workaround for this in flavor of the <code>preserveDataModel</code> attribute for the <code>&lt;t:dataTable&gt;</code>, which basically puts the datamodel in the request-specific component tree (which in turn is already stored in the session scope or in a hidden input field in the client side, depending on how you configured the store location of the view state in faces-config). RichFaces doesn't have a direct solution like that, but the <code>&lt;a4j:keepAlive&gt;</code> does basically the same. It would only affect the "whole" bean, thus if your data bean contains more than only the datamodel, you might consider to refactor it. You should keep in mind to design the bean as if it is a session scoped bean.</p> <p>If the datamodel gets large, then I can imagine that this impacts the server memory, but this shouldn't really harm that much if you only stores the <em>viewable</em> part of the datamodel in memory (and thus not the <em>entire</em> datamodel, including all the other pages). See if it outweighs the cost of firing double SQL queries during a single HTTP request. </p> <p>Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload