我有一封電子郵件輸入,我想驗證它並顯示帶有圖標的圖標是否正確。我使用帶模糊事件的p:ajax。但帶有渲染屬性的屬性不起作用。 我使用primefaces 4.0和jsf 2.2。 下面是圖片https://www.dropbox.com/s/4yi2246wzqgymcr/before.JPG前後https://www.dropbox.com/s/5bii3bv145s99ge/after.JPG使用呈現屬性更新組件不起作用
<p:row>
<p:column style="width:400px">
<h:outputLabel for="inpTextRegEmail" styleClass="outputRight" value="#{msg['regi_mail']}" />
</p:column>
<p:column style="width:30px">
<h:outputText styleClass="requiredIcon" value="∗" />
</p:column>
<p:column style="width:350px">
<p:inputText style="width:350px" id="inpTextRegEmail" value="#{regiBean.user.EMAIL}"
required="true" maxlength="75">
<f:validator immediate="true" validatorId="at.dccs.csm.gui.jsf.validator.emailValidator" />
<p:ajax event="blur" process="@this"
update="correctMail correctMailIcon incorrectMailIcon emailMSG hiasl" />
</p:inputText>
</p:column>
<p:column style="width:410px">
<h:panelGroup id="mailTip" class="fa fa-question-circle fa-2x" />
<p:tooltip for="mailTip" value="Some Help" />
<p:message id="emailMSG" for="inpTextRegEmail" />
</p:column>
</p:row>
<p:row>
<p:column style="width:400px">
<p:outputLabel styleClass="outputRight" value="Username" />
</p:column>
<p:column style="width:30px">
<p:outputLabel styleClass="requiredIcon" value=" " />
</p:column>
<p:column>
<p:outputLabel id="correctMail" style="color: green;" value="#{regiBean.user.EMAIL}" />
</p:column>
<p:column>
<h:panelGroup id="correctMailIcon" class="fa fa-check-circle fa-2x"
rendered="#{regiBean.correctUsername == true}" />
<h:panelGroup id="incorrectMailIcon" class="fa fa-minus-square fa-2x"
rendered="#{regiBean.correctUsername == false}" />
</p:column>
</p:row>
事件onblur在p:ajax標記中不受支持 – bvb1909
將此事件放入inpTextRegEmail id'p:ajax'更新屬性中。 – pudaykiran
你的意思是? \t
– bvb1909