You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Wolfgang Grossinger <wo...@teamead.com> on 2010/04/16 11:39:45 UTC

Bug in Page refresh?

We have a DropDownChoice to change the language of a page (the language 
in mapped through an enum). The handler to change the code is as follows.

                 @Override
                 protected void onSubmit(AjaxRequestTarget target) {
                     
getSession().setLocale(getLanguage().getObject().getLocale());
                     setResponsePage(getPage());
                 }

We just have 3 pages and a login page. The code works on 2 of 3 pages 
but I don't know why it doesn't work on the third page (the code to find 
the language and to get the current page seems also to be correct and 
working). My question is does anybody have some hints what I could do wrong?

Regards,

Wolfgang



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


Re: Bug in Page refresh?

Posted by Xavier López <xa...@gmail.com>.
Hi Wolfgang,

If I had to refresh the entire page on language change, I would not do it
with an Ajax Request, but with a normal one instead. I do not know how will
setResponsePage behave in a serverside Ajax callback. However, if you need
to do it with ajax, you should add the language dependent components to the
AjaxRequestTarget...

Hope that helped.

Cheers,
Xavier

2010/4/16 Wolfgang Grossinger <wo...@teamead.com>

> We have a DropDownChoice to change the language of a page (the language in
> mapped through an enum). The handler to change the code is as follows.
>
>                @Override
>                protected void onSubmit(AjaxRequestTarget target) {
>
>  getSession().setLocale(getLanguage().getObject().getLocale());
>                    setResponsePage(getPage());
>                }
>
> We just have 3 pages and a login page. The code works on 2 of 3 pages but I
> don't know why it doesn't work on the third page (the code to find the
> language and to get the current page seems also to be correct and working).
> My question is does anybody have some hints what I could do wrong?
>
> Regards,
>
> Wolfgang
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>