You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeremy Thomerson <je...@thomersonfamily.com> on 2007/09/03 01:11:32 UTC

Append anchor to form redirect URL?

On a 1.2.6 app, I have a form at the bottom of a page.  The page is
basically a forum thread page, with a long list of replies, etc, and you
reply at the bottom.  I have a SubmitLink that allows you to add files, and
then it returns you to the form.  Of course, it redirects back to a page
like http://www.foo.com/app/?wicket:interface=:35::.  BUT - at the top of
the page, of course, which means the user would have to scroll to the bottom
of the page.

Is there a way to append an anchor to the URL generated for the SubmitLink?
I've walked all through the stack for creating URLs for the
IRequestListener, but it looks like I would have to add hacks in the request
cycle to accomplish this.

I see in Link there is an appendAnchor(ComponentTag, CharSequence), but I
can't find similar for SubmitLink.

Thanks!
Jeremy Thomerson

Re: Append anchor to form redirect URL?

Posted by Kent Tong <ke...@cpttm.org.mo>.

Jeremy Thomerson-3 wrote:
> 
> Is there a way to append an anchor to the URL generated for the
> SubmitLink?
> 

Try:

		form.add(new AttributeModifier("action", null) {
			protected String newValue(String currentValue,
					String replacementValue) {
				return currentValue + "#myanchor";
			}
		});


-- 
View this message in context: http://www.nabble.com/Append-anchor-to-form-redirect-URL--tf4369650.html#a12475266
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Append anchor to form redirect URL?

Posted by Matej Knopp <ma...@gmail.com>.
It will not help you append the hash to submitlink, as wicket redirect
afterwards. So the hash would be discarded anyway. Unfortunately we can't
just preserve it during request, as the hash doesn't leave the browser, so
it's not possible to get the actual value before issuing a redirect.

One possible solution would be setRedirectPage(Page page, String hash), but
that would mean added another methods to our already not very small api.

-Matej

On 9/3/07, Jeremy Thomerson <je...@thomersonfamily.com> wrote:
>
> On a 1.2.6 app, I have a form at the bottom of a page.  The page is
> basically a forum thread page, with a long list of replies, etc, and you
> reply at the bottom.  I have a SubmitLink that allows you to add files,
> and
> then it returns you to the form.  Of course, it redirects back to a page
> like http://www.foo.com/app/?wicket:interface=:35::.  BUT - at the top of
> the page, of course, which means the user would have to scroll to the
> bottom
> of the page.
>
> Is there a way to append an anchor to the URL generated for the
> SubmitLink?
> I've walked all through the stack for creating URLs for the
> IRequestListener, but it looks like I would have to add hacks in the
> request
> cycle to accomplish this.
>
> I see in Link there is an appendAnchor(ComponentTag, CharSequence), but I
> can't find similar for SubmitLink.
>
> Thanks!
> Jeremy Thomerson
>