1
<h:form id="aform">
<p:growl id="debug-growl" showDetail="true" sticky="false" />
<p:inputText id="expression" value="#{debug.expression}" required ="true" />
<p:commandButton update="debug-growl" value="Process" action="#{debug.myaction}" />
<h:outputText value="Source regular expression: #{debug.expression}" rendered="#{not empty debug.expression}" />
</h:form>
ビーン隠すH:のoutputText素子ユーザ入力がなかった場合
@ManagedBean
@ViewScoped
public class Debug implements Serializable {
private String expression; //getter & setter is present
Iの値を入力すると、それは、次いで後h:outputText
要素に提出示します。 しかし、空の値(間違っている)を入力すると、h:outputText
要素には前の値が残っています。
値を入力しなかった場合、 'h:outputText'を非表示にするにはどうすればよいですか?
あなた@ViewScoped注釈 – JokerTheFourth
@JokerTheFourthを変更してみてください:には何、なぜ? – Kukeltje
何かを隠すために、この場合は 'Disabled'や' Rendred'を使うことができます(Rendred)。それは見えなくなります。 –