Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To the point, you'd like to retain the property responsible for the <code>rendered</code> condition in the subsequent request. There are several solutions for this problem:</p> <ol> <li><p>Put bean in session scope. It's easy, but it hurts. It's bad for user experience since changes will be reflected in all tabs/windows the user has open in the same session.</p></li> <li><p>Use <code>&lt;h:inputHidden&gt;</code> to transfer the property. In theory easy, but in practice it hurts as well. The value will namely get lost whenever a validation/conversion error has occurred in any of other inputs in the same form. This is an odditity in how JSF handles hidden input elements. A workaround is to use <code>&lt;h:inputHidden binding="#{bean.hidden}"&gt;</code> and do a <code>hidden.getValue()</code> and <code>hidden.setValue()</code> in bean.</p></li> <li><p>If you're using <code>&lt;h:commandLink&gt;</code> instead of <code>&lt;h:commandButton&gt;</code>, then you can use <code>&lt;f:param&gt;</code> to transfer the property. It will be available as request parameter, you can check for it in bean's (post)constructor.</p></li> <li><p>Use <a href="http://myfaces.apache.org/tomahawk/" rel="nofollow noreferrer">Tomahawk's</a> <a href="http://myfaces.apache.org/tomahawk-project/tomahawk/tagdoc/t_saveState.html" rel="nofollow noreferrer"><code>&lt;t:saveState&gt;</code></a>. The perfect solution as far. This will retain the value (or even a complete bean) in the subsequent request.</p></li> </ol> <p>If you're already on JSF 2.0, the <a href="http://balusc.blogspot.com/2010/06/benefits-and-pitfalls-of-viewscoped.html" rel="nofollow noreferrer"><code>@ViewScoped</code></a> would have solved this all. It behaves like the <code>&lt;t:saveState&gt;</code>.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/2118656/hcommandlink-hcommandbutton-is-not-being-invoked">commandButton/commandLink/ajax action/listener method not invoked or input value not updated</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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