You cannot programatically create a PageLink. What you can do:
- use the "page service" to generate the link itself (ie. the href part of PageLink), see PageLink.java for an example - Embed a PageLink in a Block, and render its contents to a custom writer which is backed by for example a StringWriter. This way you can get the entire output of the PageLink, including the <a> tag, etc.

I haven't followed this discussion, but I hope it helps.
Regards,
Norbi

Oscar Picasso wrote:
Hi,

Thanks for the advice, but it's not what I intend to do. I already know how to 
use a PageLink.

What I want to do, is to capture the output of a PageLink and use it in a 
parameter of another component, in that case in a FieldLabel. The actual code 
should look like this.

<span jwcid="@FieldLable" raw="true" displayName="ongl:'You should accept the ' + myPageLink" 
field="accept"/><input jwcid="[EMAIL PROTECTED]" value="ognl:tos"/>

You see the difference. I don't use a PageLink here but I want a generated 
output at myPageLink. myPageLink would be a programmatically generated PageLink.

I have already seen something similar with other kind of generated links used 
in conjuction with a RedirectException. I just don't find this example.

Oscar

Peter Svensson <[EMAIL PROTECTED]> wrote: Well, I think it's quite easy, since 
you only need to provide the name of
the page, like

go to Page1

So if you instead had

go to Page

And then had a method

public String getPage()
{
    return pagename;
}

In your class, you home free.

See
http://jakarta.apache.org/tapestry/tapestry/ComponentReference/PageLink.html
for reference

Cheers,
PS
On 4/24/06, Oscar Picasso  wrote:
Hi,

How to create programmaticlly a PageLink?

Actually I want to use the rendered pagelink inside a FieldLabel.

Something like:

displayName="ognl:myPageLink "/>

Maybe you have a better idea for what I intend to do.

Oscar


---------------------------------
Celebrate Earth Day everyday!  Discover 10 things you can do to help slow
climate change. Yahoo! Earth Day



                
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.
------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.6/324 - Release Date: 2006.04.25.

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

Reply via email to