Thanks Gary, I created my first submission to the issue tracker. Do I get a jacket or a certificate now that I belong to this exclusive group?
-----Original Message----- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 3:52 PM To: Struts Users Mailing List Subject: RE: [Shale] How to cancel the <s:commonsValidator/> >From: "James Reynolds" <[EMAIL PROTECTED]> > > > 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. > Yeah, that's a bug. The ValidatorScript should not generate javascript for components that are not rendered. Please create an issue tracker for this one - http://issues.apache.org/struts/. As a quick fix, you might try adding the same value binding to the commonValidator client attribute. <s:commonsValidator type="required" arg="Last name" server="true" client="#{members$myAccount.editName}"/> Gary > > -----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 > > >From: "James Reynolds" > > > > > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]