You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Meetesh Karia <me...@gmail.com> on 2008/01/17 16:50:44 UTC

Redirecting to bookmarkable url after change in DropDownChoice

Hi all,

I'm looking for the best way (within wicket) to end up at a bookmarkable 
url after a change in a DropDownChoice.  For example:

1. I'm at the url '/category/foo'
2. I change the category DropDownChoice to 'bar'
3. I want the user (without a manual submit) to end up at '/category/bar'

I looked through the mailing list and examples but I couldn't find a 
good example (or I missed it).  Should I use onSelectionChanged and then 
redirect from within that handler?  Will wicket handle that correctly?

Thanks,
Meetesh

Re: Redirecting to bookmarkable url after change in DropDownChoice

Posted by Martijn Dashorst <ma...@gmail.com>.
new DDC(...) {    @Override wantOnChangeNotifications() {
        return true;
    }

    public void onChange() {
        setResponsePage(Page.class, new
PageParameters("0="+getModelObjectAsString()));
    }
}



On 1/17/08, Meetesh Karia <me...@gmail.com> wrote:
>
> Hi all,
>
> I'm looking for the best way (within wicket) to end up at a bookmarkable
> url after a change in a DropDownChoice.  For example:
>
> 1. I'm at the url '/category/foo'
> 2. I change the category DropDownChoice to 'bar'
> 3. I want the user (without a manual submit) to end up at '/category/bar'
>
> I looked through the mailing list and examples but I couldn't find a
> good example (or I missed it).  Should I use onSelectionChanged and then
> redirect from within that handler?  Will wicket handle that correctly?
>
> Thanks,
> Meetesh
>



-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0