You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nathan Quirynen <na...@pensionarchitects.be> on 2015/04/28 09:40:53 UTC

Handle specific bubbled up validate event

Hi,

In a page I have a component that contains multiple forms. Now I want to 
handle the bubbled up validate event from one of these forms in my page.
I know I can handle the validate event with 
"onValidateFrom[ComponentName]()", but this handles all bubbled up 
validate events from the component I think and is not specific enough. I 
need something like "onValidateFrom[ComponentName]From[FormName]()". Is 
there a way with naming convention to do this? Or do I need to do 
something else?

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


Re: Handle specific bubbled up validate event

Posted by Lance Java <la...@googlemail.com>.
The page sees the component as a black box and doesn't know about its
internal component structure. This encapsulation is by design. If you want
more specific events you'll need to trigger them from your component.

Re: Handle specific bubbled up validate event

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Yes, it is. :)

On Tue, 28 Apr 2015 04:48:47 -0300, Nathan Quirynen  
<na...@pensionarchitects.be> wrote:

> On 28/04/15 09:40, Nathan Quirynen wrote:
>> Hi,
>>
>> In a page I have a component that contains multiple forms. Now I want  
>> to handle the bubbled up validate event from one of these forms in my  
>> page.
>> I know I can handle the validate event with  
>> "onValidateFrom[ComponentName]()", but this handles all bubbled up  
>> validate events from the component I think and is not specific enough.  
>> I need something like "onValidateFrom[ComponentName]From[FormName]()".  
>> Is there a way with naming convention to do this? Or do I need to do  
>> something else?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> I was too fast with asking. I just fixed it with following:
>
> In the onValidateFrom[FormId] inside my component I added following:
>
> componentResources.triggerEvent("validate[FormId]", null, null);
>
> and then in my page I can use following event:
>
> onValidate[FormId]From[ComponentId]()
>
> I hope this is the correct way of fixing this?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: Handle specific bubbled up validate event

Posted by Nathan Quirynen <na...@pensionarchitects.be>.
On 28/04/15 09:40, Nathan Quirynen wrote:
> Hi,
>
> In a page I have a component that contains multiple forms. Now I want 
> to handle the bubbled up validate event from one of these forms in my 
> page.
> I know I can handle the validate event with 
> "onValidateFrom[ComponentName]()", but this handles all bubbled up 
> validate events from the component I think and is not specific enough. 
> I need something like "onValidateFrom[ComponentName]From[FormName]()". 
> Is there a way with naming convention to do this? Or do I need to do 
> something else?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
I was too fast with asking. I just fixed it with following:

In the onValidateFrom[FormId] inside my component I added following:

componentResources.triggerEvent("validate[FormId]", null, null);

and then in my page I can use following event:

onValidate[FormId]From[ComponentId]()

I hope this is the correct way of fixing this?


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