Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay a outputText and a selectOneRadio without manual reload
    text
    copied!<p>I have a problem for displaying an "outputText" and a "selectOneRadio".</p> <p>What I would have is : if the user fill an inputText, then an outputText and a selectOneRadio are displayed. The main problem is that it works only if I reload manually the page.</p> <p>Here is my xhtml page :</p> <pre><code> &lt;h:form id="profil"&gt; &lt;h:outputText id="teffect1" styleClass="colonne" value="#{messages['content.effectif']}" /&gt; &lt;p:inputText id="iteffect1" value="#{effectifBean.efCadre}" validatorMessage="test" &gt; &lt;p:ajax event="change" update=":profil:wrapper" listener="#{effectifBean.efCadre}" process="@form" /&gt; &lt;/p:inputText&gt; &lt;h:panelGroup id="wrapper"&gt; &lt;h:outputText rendered="#{effectifBean.shouldRenderCadre() eq true}" value="#{messages['content.type1']}" /&gt; &lt;p:selectOneRadio rendered="#{effectifBean.shouldRenderCadre() eq true}" &gt; &lt;f:selectItem itemLabel="#{messages['content.option1']}" itemValue="1" /&gt; &lt;f:selectItem itemLabel="#{messages['content.option2']}" itemValue="2" /&gt; &lt;f:selectItem itemLabel="#{messages['content.option3']}" itemValue="3" /&gt; &lt;/p:selectOneRadio&gt; &lt;/h:panelGroup&gt; &lt;/h:form&gt; </code></pre> <p>And my beam :</p> <pre><code>public class EffectifBean { private String efCadre; public String getEfCadre() { return efCadre; } public void setEfCadre(String efCadre) { this.efCadre = efCadre; } public boolean shouldRenderCadre(){ if (efCadre != null &amp;&amp; !efCadre.isEmpty() &amp;&amp; !efCadre.equals("0")) { return true; } else return false; } </code></pre> <p>}</p> <p>Thank you for your help.</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