[jboss-user] [JBoss Seam] - Re: seam don't set the invalid after an ajax request
wuhaixing
do-not-reply at jboss.com
Wed Sep 26 10:13:01 EDT 2007
thanks,I had figure it out.and there is the code can do it's work!
in the form:
| <s:decorate id="emailFormRow" template="/layout/formRow.xhtml">
| <ui:define name="label">
| <h:outputLabel for="email" value="#{messages['register.email']}"/>
| </ui:define>
| <ui:define name="field">
| <h:inputText id="email" value="#{member.email}" required="true"
| onfocus="emailHelperShow({duration:0.5,from:0.0,to:1.0})"
| onblur="emailHelperHide({duration:0.7})">
| <a4j:support event="onchange" reRender="emailFormRow" requestDelay="0" ajaxSingle="true"/>
| </h:inputText>
| </ui:define>
| <ui:param name="fieldId" value="email"/>
| <ui:param name="validateMessage" value="#{register.emailMessage}"/>
| <ui:param name="helperContent" value="tip.email"/>
| </s:decorate>
|
it's the template
| <a4j:region id="#{fieldId}Field" selfRendered="true" regionRenderOnly="true">
| <a4j:outputPanel id="#{fieldId}Block" layout="block" styleClass="formRow">
| <ui:insert/>
| <a4j:outputPanel id="#{fieldId}Label" layout="block" styleClass="formlabel #{invalid?'errlabel':''} #{required?'required':''}">
| <ui:insert name="label"/>
| </a4j:outputPanel>
|
| <a4j:outputPanel id="#{fieldId}Input" layout="block" styleClass="formfield #{invalid?'flderr':''}">
| <ui:insert name="field"/>
| <a4j:status for="#{fieldId}Field">
| <f:facet name="start">
| <h:graphicImage value="/img/icons/ajax_process.gif"/>
| </f:facet>
| </a4j:status>
| </a4j:outputPanel>
|
| <a4j:outputPanel id="#{fieldId}Helper" layout="block" rendered="#{not empty helperContent}"
| style="left:368px;display:none;" styleClass="helpMsg helperBlock" >
| <h:outputText escape="false" value="#{messages[helperContent]}"/>
| </a4j:outputPanel>
| <rich:effect name="#{fieldId}HelperHide" for="#{fieldId}Helper" type="Fade" rendered="#{not empty helperContent}"/>
| <rich:effect name="#{fieldId}HelperShow" for="#{fieldId}Helper" type="Appear" rendered="#{not empty helperContent}"/>
| <a4j:outputPanel id="#{fieldId}MessageBlock" layout="block" styleClass="errorMsg" ajaxRendered="true" rendered="#{invalid}">
| <s:message for="#{fieldId}" globalOnly="false"/>
| </a4j:outputPanel>
| </a4j:outputPanel>
| </a4j:region>
|
I also replace div with outputPanel,put the region as the wrapper to keep the style
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088868#4088868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088868
More information about the jboss-user
mailing list