You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Theo vN <th...@gmail.com> on 2006/08/11 16:08:52 UTC

custom validator based on which button pressed

Hi

I use the same Form to either create (create button) a record or to
search (search button) for records.

I want to do input validation (only server-side is ok) when I create a
record  but not for when I search (maybe even other validation rules
for when I search).

The build in tapestry validation seems to occur before "action" and
"listener" invocations take place.

What "hook" can I use to setup a custom validator (as required or null
or whatever)  based upon which button was pressed (or which listener
is going to be invoked).

One could of course do the validation "by hand" in the final listener
methods, but that would be a pity.

Thanks in advance
-- 
Regards
Theo

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


Re: custom validator based on which button pressed

Posted by Simon Raveh <si...@sns-soft.com>.
One of my requirements is  for the application to work correctly when 
javascript is turned off.

Simon

Karthik N wrote:
> any reason why you'd not like to use javascript?
>
> On 8/11/06, *Simon Raveh* <simonr@sns-soft.com 
> <ma...@sns-soft.com>> wrote:
>
>     Is there a way to tie a submit button to the refresh/cancel listener
>     without  using javascript using tapestry 4.0
>
>     Simon
>
>     Karthik N wrote:
>     > your search should be bound to the form refresh listener - that way
>     > validations won't fire.
>     >
>     > On 8/11/06, Theo vN < theovn@gmail.com
>     <ma...@gmail.com>> wrote:
>     >>
>     >> Hi
>     >>
>     >> I use the same Form to either create (create button) a record or to
>     >> search (search button) for records.
>     >>
>     >> I want to do input validation (only server-side is ok) when I
>     create a
>     >> record  but not for when I search (maybe even other validation
>     rules
>     >> for when I search).
>     >>
>     >> The build in tapestry validation seems to occur before "action" and
>     >> "listener" invocations take place.
>     >>
>     >> What "hook" can I use to setup a custom validator (as required
>     or null
>     >> or whatever)  based upon which button was pressed (or which
>     listener
>     >> is going to be invoked).
>     >>
>     >> One could of course do the validation "by hand" in the final
>     listener
>     >> methods, but that would be a pity.
>     >>
>     >> Thanks in advance
>     >> --
>     >> Regards
>     >> Theo
>     >>
>     >>
>     ---------------------------------------------------------------------
>     >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>     >> For additional commands, e-mail: users-help@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>     >>
>     >>
>     >
>     >
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>     For additional commands, e-mail: users-help@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>
>
>
>
> -- 
> Thanks, Karthik 


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


Re: custom validator based on which button pressed

Posted by Karthik N <ka...@gmail.com>.
any reason why you'd not like to use javascript?

On 8/11/06, Simon Raveh <si...@sns-soft.com> wrote:
>
> Is there a way to tie a submit button to the refresh/cancel listener
> without  using javascript using tapestry 4.0
>
> Simon
>
> Karthik N wrote:
> > your search should be bound to the form refresh listener - that way
> > validations won't fire.
> >
> > On 8/11/06, Theo vN <th...@gmail.com> wrote:
> >>
> >> Hi
> >>
> >> I use the same Form to either create (create button) a record or to
> >> search (search button) for records.
> >>
> >> I want to do input validation (only server-side is ok) when I create a
> >> record  but not for when I search (maybe even other validation rules
> >> for when I search).
> >>
> >> The build in tapestry validation seems to occur before "action" and
> >> "listener" invocations take place.
> >>
> >> What "hook" can I use to setup a custom validator (as required or null
> >> or whatever)  based upon which button was pressed (or which listener
> >> is going to be invoked).
> >>
> >> One could of course do the validation "by hand" in the final listener
> >> methods, but that would be a pity.
> >>
> >> Thanks in advance
> >> --
> >> Regards
> >> Theo
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>


-- 
Thanks, Karthik

Re: custom validator based on which button pressed

Posted by Simon Raveh <si...@sns-soft.com>.
Is there a way to tie a submit button to the refresh/cancel listener  
without  using javascript using tapestry 4.0

Simon

Karthik N wrote:
> your search should be bound to the form refresh listener - that way
> validations won't fire.
>
> On 8/11/06, Theo vN <th...@gmail.com> wrote:
>>
>> Hi
>>
>> I use the same Form to either create (create button) a record or to
>> search (search button) for records.
>>
>> I want to do input validation (only server-side is ok) when I create a
>> record  but not for when I search (maybe even other validation rules
>> for when I search).
>>
>> The build in tapestry validation seems to occur before "action" and
>> "listener" invocations take place.
>>
>> What "hook" can I use to setup a custom validator (as required or null
>> or whatever)  based upon which button was pressed (or which listener
>> is going to be invoked).
>>
>> One could of course do the validation "by hand" in the final listener
>> methods, but that would be a pity.
>>
>> Thanks in advance
>> -- 
>> Regards
>> Theo
>>
>> ---------------------------------------------------------------------
>> 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


Re: custom validator based on which button pressed

Posted by Karthik N <ka...@gmail.com>.
your search should be bound to the form refresh listener - that way
validations won't fire.

On 8/11/06, Theo vN <th...@gmail.com> wrote:
>
> Hi
>
> I use the same Form to either create (create button) a record or to
> search (search button) for records.
>
> I want to do input validation (only server-side is ok) when I create a
> record  but not for when I search (maybe even other validation rules
> for when I search).
>
> The build in tapestry validation seems to occur before "action" and
> "listener" invocations take place.
>
> What "hook" can I use to setup a custom validator (as required or null
> or whatever)  based upon which button was pressed (or which listener
> is going to be invoked).
>
> One could of course do the validation "by hand" in the final listener
> methods, but that would be a pity.
>
> Thanks in advance
> --
> Regards
> Theo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Thanks, Karthik