You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by 孟凡振 <fa...@gmail.com> on 2008/04/11 03:34:21 UTC

help in method triger

I am using typestry5 with extjs......
in extjs I can call tayesry method with a <actionLink/> tag in *.tml and a
OnEvent describing the methon in page class..

Now, for some reason ,I must remove the <actionLink> in  *.tml,but method
still can be called in extjs.

would  some warmheart people can give me a  answer..

in my  opinion,  some thing  ,meybe a url....................but I can't
catch it!!!

Re: help in method triger

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

If you inject ComponentResources in your page you can use that to 
generate an action link that you can send to the client. You can then 
use this link to trigger the event.

Something like this in your page class:

   @Inject
   private ComponentResources componentResources;

   public String getMyActionLink() {
     // you can pass parameters as well if you need to
     return componentResources.createActionLink("myaction").toURI();
   }

   void onMyAction() {
     // do your stuff here, parameters are passed to the method as always
   }

You can then use ${myactionlink} in your template to trigger the event.

Hope that makes sense.

-Filip

On 2008-04-11 03:34, 孟凡振 wrote:
> I am using typestry5 with extjs......
> in extjs I can call tayesry method with a <actionLink/> tag in *.tml and a
> OnEvent describing the methon in page class..
> 
> Now, for some reason ,I must remove the <actionLink> in  *.tml,but method
> still can be called in extjs.
> 
> would  some warmheart people can give me a  answer..
> 
> in my  opinion,  some thing  ,meybe a url....................but I can't
> catch it!!!
> 

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