You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jer Kah <je...@gmail.com> on 2005/06/23 15:52:11 UTC

anchor tag, LinkSubmit, DirectLink, and submitting forms

I'm building an app that's similar (but more complex than )  to the
ToDo List app Howard made for Tapestry In Action.  The user can add
items to a growing list with a @LinkSubmit at the bottom labelled "Add
Another".  It's a @LinkSubmit because I need to submit the info they
just entered and then add a new empty item to the bottom of the list. 
The problem is that after I hit the link, I end up at the top of the
page and I don't want to scroll down each time.  I know that
@DirectLink has the "Anchor" tag, but I can't use the @DirectLink in
this situation (unless I can submit the form from within it's listener
- if that's possible, please tell!!).  Do you know of any way to
accomplish what I'm after?

Thanks,
  Jer

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


Re: anchor tag, LinkSubmit, DirectLink, and submitting forms

Posted by Jer Kah <je...@gmail.com>.
I'm not getting how to do this.  I've tried

throw new RedirectException(getEngine().getService(Tapestry.PAGE_SERVICE).getLink(
            cycle, null, new String[]
            { "myPageName#bottom" }).getURL() );

and 

throw new RedirectException(getEngine().getService(Tapestry.PAGE_SERVICE).getLink(
            cycle, null, new String[]
            { "myPageName" }).getURL() + "#bottom" );

Both times I get an error screen saying that the page
"myPageName#bottom" cannot be found.  I'm doing something wrong, but I
don't know what that something is.  Any help?

Thanks,
  Jer



On 6/24/05, Kent Tong <ke...@cpttm.org.mo> wrote:
> Jer Kah <jerkah <at> gmail.com> writes:
> 
> > The problem is that after I hit the link, I end up at the top of the
> > page and I don't want to scroll down each time.  I know that
> >  <at> DirectLink has the "Anchor" tag, but I can't use the  <at> DirectLink in
> > this situation (unless I can submit the form from within it's listener
> > - if that's possible, please tell!!).  Do you know of any way to
> > accomplish what I'm after?
> 
> Have you tried throwing a RedirectException at the end of your
> listener to redirect the browser to an URL which contains an
> anchor?
> 
> --
> Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

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


Re: anchor tag, LinkSubmit, DirectLink, and submitting forms

Posted by Kent Tong <ke...@cpttm.org.mo>.
Jer Kah <jerkah <at> gmail.com> writes:

> The problem is that after I hit the link, I end up at the top of the
> page and I don't want to scroll down each time.  I know that
>  <at> DirectLink has the "Anchor" tag, but I can't use the  <at> DirectLink in
> this situation (unless I can submit the form from within it's listener
> - if that's possible, please tell!!).  Do you know of any way to
> accomplish what I'm after?

Have you tried throwing a RedirectException at the end of your
listener to redirect the browser to an URL which contains an
anchor?

--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)


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