You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Chris Poulsen <ch...@nesluop.dk> on 2008/02/15 00:09:00 UTC

T5: onValidate() not being called in 5.0.10

Hi,

I've been playing around with some validation in T5.

(The docs could really use an example with onValidate for cross field 
validation of this in the "input validation" page! [at least to let 
people know that they have the correct method signature etc] )

After googling and lots of trial and "no indication of the method being 
called (placed a sys.out.print in there)" - I decided to try and 
downgrade to 5.0.9 and suddenly my onValidate() method was being called 
(indicated by the sys.out.print).

Has validation changed on purpose or is this a regression?

Also I would like to perform "cross field" validation in a component (on 
its nested fields, for instance making sure a period start date is 
before period end date), but once again I'm having trouble with both 
docs and all my shotgun attempts (basically trying to supply another 
onValidate) - is this supported currently and how ;)

TIA!

-- 
Regards Chris

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


Re: T5: onValidate() not being called in 5.0.10

Posted by Chris Poulsen <ch...@nesluop.dk>.
Hi,

Howard Lewis Ship wrote:
> This changed recently; I noticed a conflict between the validate event
> fired by TextField and the validate event fired by the Form.
> 
> I decided to resolve this by renaming the Form's event from "validate"
> to "validateForm".
> 
> The documentation, including the component reference page
> (http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html)
> was updated, but not enough other notice was made.

Thank you for the quick reply. "validateForm" does indeed work! It would 
be great with some kind of easily accessible changelog.

> On Thu, Feb 14, 2008 at 3:09 PM, Chris Poulsen <ch...@nesluop.dk> wrote:
>> Hi,
>>
>>  I've been playing around with some validation in T5.
>>
<snip>
>>
>>  Also I would like to perform "cross field" validation in a component (on
>>  its nested fields, for instance making sure a period start date is
>>  before period end date), but once again I'm having trouble with both
>>  docs and all my shotgun attempts (basically trying to supply another
>>  onValidate) - is this supported currently and how ;)
>>
>>  TIA!
>>
>>  --
>>  Regards Chris

Can anyone provide a hint on how to get my other issue - the cross-field 
validation in components up and running? (I would like to have a 
validate method in the component that is able to make sure the fields in 
the component have sane values - just like validateForm works on page level.

--
Regards Chris





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


Re: T5: onValidate() not being called in 5.0.10

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

I have this in T5.0.9:

   @Component
    private Form myForm;

    public void onValidateFromMyForm() throws EncoderException {}
this works, but if I change it to:
   public void onValidateForm(), it is not called.

A.C.



Howard Lewis Ship wrote:
> 
> This changed recently; I noticed a conflict between the validate event
> fired by TextField and the validate event fired by the Form.
> 
> I decided to resolve this by renaming the Form's event from "validate"
> to "validateForm".
> 
> The documentation, including the component reference page
> (http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html)
> was updated, but not enough other notice was made.
> 
> On Thu, Feb 14, 2008 at 3:09 PM, Chris Poulsen <ch...@nesluop.dk> wrote:
>> Hi,
>>
>>  I've been playing around with some validation in T5.
>>
>>  (The docs could really use an example with onValidate for cross field
>>  validation of this in the "input validation" page! [at least to let
>>  people know that they have the correct method signature etc] )
>>
>>  After googling and lots of trial and "no indication of the method being
>>  called (placed a sys.out.print in there)" - I decided to try and
>>  downgrade to 5.0.9 and suddenly my onValidate() method was being called
>>  (indicated by the sys.out.print).
>>
>>  Has validation changed on purpose or is this a regression?
>>
>>  Also I would like to perform "cross field" validation in a component (on
>>  its nested fields, for instance making sure a period start date is
>>  before period end date), but once again I'm having trouble with both
>>  docs and all my shotgun attempts (basically trying to supply another
>>  onValidate) - is this supported currently and how ;)
>>
>>  TIA!
>>
>>  --
>>  Regards Chris
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>  For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-onValidate%28%29-not-being-called-in-5.0.10-tp15491663p15493466.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.


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


Re: T5: onValidate() not being called in 5.0.10

Posted by Howard Lewis Ship <hl...@gmail.com>.
This changed recently; I noticed a conflict between the validate event
fired by TextField and the validate event fired by the Form.

I decided to resolve this by renaming the Form's event from "validate"
to "validateForm".

The documentation, including the component reference page
(http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html)
was updated, but not enough other notice was made.

On Thu, Feb 14, 2008 at 3:09 PM, Chris Poulsen <ch...@nesluop.dk> wrote:
> Hi,
>
>  I've been playing around with some validation in T5.
>
>  (The docs could really use an example with onValidate for cross field
>  validation of this in the "input validation" page! [at least to let
>  people know that they have the correct method signature etc] )
>
>  After googling and lots of trial and "no indication of the method being
>  called (placed a sys.out.print in there)" - I decided to try and
>  downgrade to 5.0.9 and suddenly my onValidate() method was being called
>  (indicated by the sys.out.print).
>
>  Has validation changed on purpose or is this a regression?
>
>  Also I would like to perform "cross field" validation in a component (on
>  its nested fields, for instance making sure a period start date is
>  before period end date), but once again I'm having trouble with both
>  docs and all my shotgun attempts (basically trying to supply another
>  onValidate) - is this supported currently and how ;)
>
>  TIA!
>
>  --
>  Regards Chris
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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