You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jiju <ji...@ibsplc.com> on 2007/01/24 14:19:16 UTC

Re: how to Disable validations dynamically

Hi all,
I am also facing the same problem...
is there any way to disable validation for some button clicks ?




Reto Hotz wrote:
> 
> Hello,
> 
> I have a @Form with a validationDelegate. Inside this form there is a
> custom component. There are also several @TextFields with
> validators-rules after the custom-component. The custom component has
> a @Submit button.
> 
> My problem is, when the submit button of that custom component is
> pressed, the validator of the form gets triggered. But at this time
> there shouldn't be a validation at all. The validation should start
> when the submit-button of the form itself is pressed.
> 
> I tried it this way in my component:
> 
> /* submit listener of component */
> public void formActionFindMachine() {
>   IValidationDelegate delegate = getForm().getDelegate();
>   delegate.clearErrors();
> }
> 
> This works, but if the TextFields are located after the custom
> component, they still record their validation errors.
> 
> I think I oversee something.
> 
> Thank for any help.
> 
> Greetings
> Reto
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ValidationDelegate-and-Form-Component-tf3065098.html#a8560178
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: how to Disable validations dynamically

Posted by Reto Hotz <re...@gmail.com>.
Hi,

This is how I did it at the end:

In html:

<input jwcid="@Submit" value="Submit Form"
listener="listener:formActionSubmit" selected="ognl:selectedSubmit"
tag="literal:useValidators"/>

And then in java:

public abstract String getSelectedSubmit();

public void renderPage(IMarkupWriter writer, IRequestCycle cycle) {
  if ( !"useValidators".equals(getSelectedSubmit() ) {
    getValidationDelegate().clearErrors();
  }
}

Greetings
Reto

On 1/24/07, jiju <ji...@ibsplc.com> wrote:
>
> Hi all,
> I am also facing the same problem...
> is there any way to disable validation for some button clicks ?
>
>
>
>
> Reto Hotz wrote:
> >
> > Hello,
> >
> > I have a @Form with a validationDelegate. Inside this form there is a
> > custom component. There are also several @TextFields with
> > validators-rules after the custom-component. The custom component has
> > a @Submit button.
> >
> > My problem is, when the submit button of that custom component is
> > pressed, the validator of the form gets triggered. But at this time
> > there shouldn't be a validation at all. The validation should start
> > when the submit-button of the form itself is pressed.
> >
> > I tried it this way in my component:
> >
> > /* submit listener of component */
> > public void formActionFindMachine() {
> >   IValidationDelegate delegate = getForm().getDelegate();
> >   delegate.clearErrors();
> > }
> >
> > This works, but if the TextFields are located after the custom
> > component, they still record their validation errors.
> >
> > I think I oversee something.
> >
> > Thank for any help.
> >
> > Greetings
> > Reto
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/ValidationDelegate-and-Form-Component-tf3065098.html#a8560178
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org