When are setValue and setSubmittedValue called on UIComponent?

admin

Administrator
Staff member
If I correctly combined the information contained in BalusC's great 2006 post <a href="http://balusc.blogspot.ch/2006/09/debug-jsf-lifecycle.html" rel="nofollow">http://balusc.blogspot.ch/2006/09/debug-jsf-lifecycle.html</a> with Optimus Prime's even earlier post <a href="http://cagataycivici.wordpress.com/2005/12/28/jsf_component_s_value_local/" rel="nofollow">http://cagataycivici.wordpress.com/2005/12/28/jsf_component_s_value_local/</a> I get the following:

<strong>My understanding:</strong>

<ol>
<li>During the APPLY_REQUEST_VALUES phase,
<ul>
<li>the input value is set to a submittedValue property of the UI component (e.g. inputComponent.<strong>setSubmittedValue</strong>("test")).</li>
</ul></li>
<li>During the PROCESS_VALIDATIONS phase,
<ul>
<li>the same values are read from the submittedValue property (presumably inputComponent.<strong>getSubmittedValue</strong>()) and used for conversion, if necessary.</li>
<li>If the conversion was successful or skipped, the result is set to a value property of the component (e.g. inputComponent.<strong>setValue</strong>("test")). </li>
<li>Also, the submittedValue is erased again immediately (e.g. inputComponent.<strong>setSubmittedValue</strong>(null))</li>
<li>the (converted) value is read from the value property of the UI component (presumably inputComponent.<strong>getValue()</strong>) and validated.</li>
<li>after validation, the backing bean/model's stored value is read (e.g. myBean.<strong>getInputValue</strong>()) and compared with the newly converted and validated value. If different, the valueChangeListener method(s) will be called.</li>
</ul></li>
<li>During the UPDATE_MODEL_VALUES phase,
<ul>
<li>the newly converted and validated value is finally stored in the backing bean's property field (e.g. myBean.<strong>setInputValue</strong>("test")).</li>
</ul></li>
</ol>

<strong>Questions:</strong>

<ul>
<li>Is this correct?</li>
<li>Is there something missing for a full understanding of what goes on between the POST and the saving of the input value in the backing bean?</li>
<li>With immediate="true" on the Input Component, are we merely shifting these events to the APPLY_REQUEST_VALUES phase or do we change more than just the timing/order of events?</li>
</ul>