You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cyril Godefroy <cy...@ecomposite.fr> on 2004/07/23 08:47:01 UTC

Generating link url

I don't know from where I  should take this one:
I want to generate a string that would be the url to an action link, 
without all the anchor html stuff. I had a look into ActionLink and 
AbstractLinkComponent but things are a little obscure still.
I first had the idea to insert a useless, no content action link, then 
get its link from getLink(), but that is unsatisfactory (though it 
would probably work).
Rewriting the actionlink component or the defaultlinkrenderer seems a 
bit stupid also.
Last but not least, I should be able to create the url from scratch, 
but how?

Is there a nice and wise way I didn't think of?

The goal of the operation? Provide the url to a tapestry generated xml 
to an object that is embedded in the html page (a flash file).

eCOMPOSITE
J2EE & Multimedia
cyril@ecomposite.fr
Tel 06 63 16 45 41

Re: Generating link url

Posted by Cyril Godefroy <cy...@ecomposite.fr>.
I did end up struggling with nextActionId() and ActionLink(), getting 
around the cycle.nextActionId to retrieve the url from an ActionLink 
that is right before in the template.

Not a very satisfactory solution, but it works.

Cyril

Re: Generating link url

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Disclaimer: it's late, I'm tired. Take the following w/ a grain of salt. ;)

You might try something like:

getALink() {
IEngineService service = 
cycle.getEngine().getService(Tapestry.ACTION_SERVICE);
service.getLink(cycle, this, new Object[] { cycle.getNextActionId() });
}

You would need to make whatever component has the getALink method 
implement the IAction interface, but that's pretty trivial, as it only 
has a single method.


Robert

Cyril Godefroy wrote:
> I don't know from where I  should take this one:
> I want to generate a string that would be the url to an action link, 
> without all the anchor html stuff. I had a look into ActionLink and 
> AbstractLinkComponent but things are a little obscure still.
> I first had the idea to insert a useless, no content action link, then 
> get its link from getLink(), but that is unsatisfactory (though it would 
> probably work).
> Rewriting the actionlink component or the defaultlinkrenderer seems a 
> bit stupid also.
> Last but not least, I should be able to create the url from scratch, but 
> how?
> 
> Is there a nice and wise way I didn't think of?
> 
> The goal of the operation? Provide the url to a tapestry generated xml 
> to an object that is embedded in the html page (a flash file).
> 
> eCOMPOSITE
> J2EE & Multimedia
> cyril@ecomposite.fr
> Tel 06 63 16 45 41


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