Hmm, I downloaded the latest Shale libs and the first thing I notice is
that the validator fires for an h:inputText that isn't rendered.  This
is what I have on my page:

<h:outputText value="Last Name:"/>

                    <h:outputText
value="#{sessionScope.visit.user.lastName}"
                                  style="font-weight:bold;"
 
rendered="#{!members$myAccount.editName}"/>
                    <h:inputText id="lastName"
 
value="#{sessionScope.visit.user.lastName}"
 
rendered="#{members$myAccount.editName}"
 
binding="#{members$myAccount.lastNameInput}"
                                 required="true">
                        <s:commonsValidator type="required"
                                            arg="Last name"
                                            server="true"
                                            client="true"/>
                        <h:message for="lastName"
errorClass="errorText"/>
                    </h:inputText>

The inputText boxes are not rendered unless the user clicks a "Update
Name" button that changes the boolean "editName" property.  The problem
is that the Update Name button is triggering the validation on the
un-rendered InputText control.

I suppose the form's onSubmit event caller assumes the existence of the
Input boxes.


-----Original Message-----
From: Gary VanMatre [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 23, 2006 12:52 PM
To: Struts Users Mailing List
Subject: Re: [Shale] How to cancel the <s:commonsValidator/>

>From: "James Reynolds" <[EMAIL PROTECTED]>
>
> 
> I'm coding a cancel button on an update form. I've set its immediate 
> attribute to true, but that isn't skipping the client side validation.
> Is there a way to do this, or must I only use server validation in 
> this case?
> 

If you are using the JSF runtime commandButton or commandLink component,
the JavaScript, "bCancel=true;", will be injected into the onclick event
when the "immediate" is set to "true".

http://issues.apache.org/struts/browse/SHALE-37

Originally, this worked for all the "javax.faces.Command" family but it
was just limited to the two JSF runtime command components due to a
tomahawk component issue,
http://issues.apache.org/struts/browse/SHALE-68.
 
Gary


> Thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to