To be more precise Francois is suggesting you use PageLinks with a
context and handle the "actions" in the destination page onActivate.

If that really doesn't fit your use case I suppose another avenue to
explore would be to expose the pages' resources:
(This could go in a base class.)

    @Inject
    private ComponentResources resources;
...
    public ComponentResources getResources()
    {
        return resources;
    }

and then manually construct links getting the URL's in your component
by injecting the pages and using their resources. Something like:

String getSomePageSomeActionUrl()
{
    _somePage.getResources().createActionLink("someAction", false, new 
Object[0]).toURI();
}

No time to play with this sorry, but it might be worth a crack.

Cheers,
Nick.


Francois Armand wrote:
Chris Lewis wrote:
[...] For example, say I have a handful of pages in my app (Logout, NewUpload, NewComment), and I want my component to be able to create links to these pages that would trigger an action. I don't see how this is possible with actionlink. It seems that actionlinks always fire an action in the component or page class, but cannot be used to trigger actions in other pages or components! Am I misunderstanding or overlooking something?
Well, I think that the behavior of action link is ok : if you want to fire an action on the target page, there is no need to have a special action handler in the target, you simply can pass a parameter into the context of the link, and analyze it on the target, when onActivate occurs. For more information, see : http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to