You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Oscar Picasso <os...@yahoo.com> on 2006/04/24 23:25:11 UTC

Programmatically create PageLink ?

Hi,

How to create programmaticlly a PageLink?

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

Something like:
<span jwci="@FieldLabel" field="myField" raw="true" 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

Re: Programmatically create PageLink ?

Posted by Oscar Picasso <os...@yahoo.com>.
Yes that was the kind of thing I was thinking of. I just forgot where the information was.

Aleksej <al...@ivs.lt> wrote: If you need to form link value by your self ( URL address ) then you need
to get appropriate IServiceEngine for it.
Maybe this will help to understand how does it works:  
http://www.tapestryforums.com/force-redirect-vt880.html

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



		
---------------------------------
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

Re: Programmatically create PageLink ?

Posted by Aleksej <al...@ivs.lt>.
If you need to form link value by your self ( URL address ) then you need
to get appropriate IServiceEngine for it.
Maybe this will help to understand how does it works:  
http://www.tapestryforums.com/force-redirect-vt880.html

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


Re: Programmatically create PageLink ?

Posted by Oscar Picasso <os...@yahoo.com>.
It helps a lot. That was I was looking for. Thanks.

Oscar

Onno Scheffers <on...@piraya.nl> wrote: Oscar Picasso schreef:

>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.
>  
>
Would this help? I use it to generate the URL to a page through the 
PageService:

   @InjectObject("engine-service:page")
   public abstract IEngineService getPageService();

   public String getPageURL(IRequestCycle cycle, String pageName) {
     return getPageService().getLink(false, pageName).getURL();
   }

If you really want to capture the output of a component, I think you 
need to provide your own MarkupWriter and parse it contents?

Regards,

Onno


> [input] 
>
>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 
 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.
>  
>


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




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

Re: Programmatically create PageLink ?

Posted by Onno Scheffers <on...@piraya.nl>.
Oscar Picasso schreef:

>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.
>  
>
Would this help? I use it to generate the URL to a page through the 
PageService:

   @InjectObject("engine-service:page")
   public abstract IEngineService getPageService();

   public String getPageURL(IRequestCycle cycle, String pageName) {
     return getPageService().getLink(false, pageName).getURL();
   }

If you really want to capture the output of a component, I think you 
need to provide your own MarkupWriter and parse it contents?

Regards,

Onno


><span jwcid="@FieldLable" raw="true" displayName="ongl:'You should accept the ' + myPageLink" field="accept"/><input jwcid="accept@Checkbox" 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 <ps...@gmail.com> 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.
>  
>


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


Re: Programmatically create PageLink ?

Posted by Norbert Sándor <de...@erinors.com>.
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="accept@Checkbox" 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 <ps...@gmail.com> 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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Programmatically create PageLink ?

Posted by Oscar Picasso <os...@yahoo.com>.
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="accept@Checkbox" 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 <ps...@gmail.com> 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.

Re: Programmatically create PageLink ?

Posted by Peter Svensson <ps...@gmail.com>.
Well, I think it's quite easy, since you only need to provide the name of
the page, like

<a jwcid="@PageLink" page="Page1">go to Page1</a>

So if you instead had

<a jwcid="@PageLink" page="ognl:page">go to Page</a>

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 <os...@yahoo.com> wrote:
>
> Hi,
>
> How to create programmaticlly a PageLink?
>
> Actually I want to use the rendered pagelink inside a FieldLabel.
>
> Something like:
> <span jwci="@FieldLabel" field="myField" raw="true"
> 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
>