You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Da...@expeditors.com on 2005/06/16 00:04:09 UTC

link to fragment identifier

In "raw" HTML, I can create an anchor with a name as a fragment 
identifier, like this:

<a name="HalfWayDownThePage" 
href="http://www.mydns.com/MyNextPage.html">This link goes to 
MyNextPage</a>

Then provide a link to that page like this:

<a href="http://www.mydns.com/MyFirstPage.html#HalfWayDownThePage">This 
link goes to the middle of MyFirstPage</a>

But when I try to do that in my Java code for Tapestry, it doesn't work:

public void gotoMidOfFirstPageAction(IRequestCycle cycle)
{
        cycle.activate("MyFirstPage#HalfWayDownThePage");
}

The above throws an exception.

Is there any way to do this in Tapestry?

Regards,
David Lee Sanford

Re: link to fragment identifier

Posted by Norbert Sándor <de...@freemail.hu>.
If you use the built-in link components (Action/Direct/PageLink etc) then 
specify the "anchor" parameter like:
<a jwcid="@PageLink" page="Home" anchor="HalfWayDownPage"> .....
It generates the link's URL with "#HalfWayDownPage" appended to it.

(IRequestCycle.activate() expects only a page name. Maybe RedirectException 
allows an anchor...)

Br,
Norbi

----- Original Message ----- 
From: <Da...@expeditors.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, June 16, 2005 12:04 AM
Subject: link to fragment identifier


> In "raw" HTML, I can create an anchor with a name as a fragment
> identifier, like this:
>
> <a name="HalfWayDownThePage"
> href="http://www.mydns.com/MyNextPage.html">This link goes to
> MyNextPage</a>
>
> Then provide a link to that page like this:
>
> <a href="http://www.mydns.com/MyFirstPage.html#HalfWayDownThePage">This
> link goes to the middle of MyFirstPage</a>
>
> But when I try to do that in my Java code for Tapestry, it doesn't work:
>
> public void gotoMidOfFirstPageAction(IRequestCycle cycle)
> {
>        cycle.activate("MyFirstPage#HalfWayDownThePage");
> }
>
> The above throws an exception.
>
> Is there any way to do this in Tapestry?
>
> Regards,
> David Lee Sanford
> 



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