Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><em>It seems that it is a new instance of component invoked when decode is trigered and components are not present.</em></p> </blockquote> <p>That's correct. Component instances are not stored in the view state. Instead, the component's state is stored in the view state. The component's state can be managed by the helper class <a href="http://docs.oracle.com/javaee/6/api/javax/faces/component/StateHelper.html" rel="nofollow noreferrer"><code>StateHelper</code></a> which is available by <a href="http://docs.oracle.com/javaee/6/api/javax/faces/component/UIComponent.html#getStateHelper%28%29" rel="nofollow noreferrer"><code>UIComponent#getStateHelper()</code></a>.</p> <p>So, during encode do:</p> <pre><code>// ... getStateHelper().put("someKey", someKey); </code></pre> <p>And during decode do:</p> <pre><code>SomeKey someKey = (SomeKey) getStateHelper().eval("someKey"); // ... </code></pre> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/9405278/how-to-save-state-when-extending-uicomponentbase">How to save state when extending UIComponentBase</a></li> <li><a href="https://stackoverflow.com/questions/13015942/jsf-composite-component-weird-behavior-when-trying-to-save-state">JSF composite component - weird behavior when trying to save state</a></li> <li><a href="https://stackoverflow.com/questions/11866981/jsf-2-custom-components-having-expression-language-for-attribute-value-dont-tri">JSF 2 Custom components having Expression Language for attribute value don&#39;t trigger the attribute setter</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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