You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nn kk <in...@abv.bg> on 2014/07/19 00:10:10 UTC

How to call onSuccess in components from page

 
Hi everyone,
I have a page with a couple of custom components in it, most of them are containing different inputs. In the page after all components I have submit button. By pressing the submit button I want to execute different things in the components. I thought the onSuccess methods in the components will be called, but they are not. I want to call some methods from the components but I can not access them, because these components are not injected in my java class, they are only injected in the tml file as markup, because it's being done inside a loop, they are dynamic number. Is there a way to fire event from the page and to be caught in the components? I saw only the onValidate is called everywhere, but onSuccess, onSubmit, etc. - not

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


Re: How to call onSuccess in components from page

Posted by Chris Mylonas <ch...@opencsta.org>.
Relevant example & reading

http://jumpstart.doublenegative.com.au/jumpstart/examples/component/eventbubbling

http://tapestry.apache.org/component-events.html

If model/flowchart, the page is at the top of the hierarchy, not the
bottom.  Think java not html.
On Jul 19, 2014 9:17 AM, "Thiago H de Paula Figueiredo" <th...@gmail.com>
wrote:

> On Fri, 18 Jul 2014 19:10:10 -0300, nn kk <in...@abv.bg> wrote:
>
>  Hi everyone,
>>
>
> Hi!
>
> Remember that events bubble up: from the component that triggered it to
> its parent and so on until it reachs the page. So, if your components are
> inside a form, the form events won't be triggered on these components. Why
> your components need to know when the form is submitted?
>
>  I have a page with a couple of custom components in it, most of them are
>> containing different inputs. In the page after all components I have submit
>> button. By pressing the submit button I want to execute different things in
>> the components. I thought the onSuccess methods in the components will be
>> called, but they are not. I want to call some methods from the components
>> but I can not access them, because these components are not injected in my
>> java class, they are only injected in the tml file as markup, because it's
>> being done inside a loop, they are dynamic number. Is there a way to fire
>> event from the page and to be caught in the components? I saw only the
>> onValidate is called everywhere, but onSuccess, onSubmit, etc. - not
>>
>> ---------------------------------------------------------------------
>> 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: How to call onSuccess in components from page

Posted by Geoff Callender <ge...@gmail.com>.
What behaviour do you want your page to have? I'm asking because the approach that you describe below might not be the best way to go about it.


On 19 Jul 2014, at 9:16 am, Thiago H de Paula Figueiredo <th...@gmail.com> wrote:

> On Fri, 18 Jul 2014 19:10:10 -0300, nn kk <in...@abv.bg> wrote:
> 
>> Hi everyone,
> 
> Hi!
> 
> Remember that events bubble up: from the component that triggered it to its parent and so on until it reachs the page. So, if your components are inside a form, the form events won't be triggered on these components. Why your components need to know when the form is submitted?
> 
>> I have a page with a couple of custom components in it, most of them are containing different inputs. In the page after all components I have submit button. By pressing the submit button I want to execute different things in the components. I thought the onSuccess methods in the components will be called, but they are not. I want to call some methods from the components but I can not access them, because these components are not injected in my java class, they are only injected in the tml file as markup, because it's being done inside a loop, they are dynamic number. Is there a way to fire event from the page and to be caught in the components? I saw only the onValidate is called everywhere, but onSuccess, onSubmit, etc. - not
>> 
>> ---------------------------------------------------------------------
>> 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
> 


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


Re: How to call onSuccess in components from page

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 18 Jul 2014 19:10:10 -0300, nn kk <in...@abv.bg> wrote:

> Hi everyone,

Hi!

Remember that events bubble up: from the component that triggered it to  
its parent and so on until it reachs the page. So, if your components are  
inside a form, the form events won't be triggered on these components. Why  
your components need to know when the form is submitted?

> I have a page with a couple of custom components in it, most of them are  
> containing different inputs. In the page after all components I have  
> submit button. By pressing the submit button I want to execute different  
> things in the components. I thought the onSuccess methods in the  
> components will be called, but they are not. I want to call some methods  
> from the components but I can not access them, because these components  
> are not injected in my java class, they are only injected in the tml  
> file as markup, because it's being done inside a loop, they are dynamic  
> number. Is there a way to fire event from the page and to be caught in  
> the components? I saw only the onValidate is called everywhere, but  
> onSuccess, onSubmit, etc. - not
>
> ---------------------------------------------------------------------
> 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