You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by cosmindumy <co...@yahoo.com> on 2012/02/13 14:57:08 UTC
Promlem with date format on changing locale
Hello again,
I have the following problem. I have a customized DateTimePanel component,
wich has a DateTextFiled. The problem is that when I change the locale and
pressing submit the date is not valid anymore due to date format.
For example I have set the locale de-DE, date looks 02.02.2012 I press
submit, lets say the validation fails for other reason, when I change the
locale to en-GB the date is still the german format. I have to choose again
the date, and now it has the right format. If I don't press submit, when
changing back to de-DE the date has the german format(even if before was
english format). If I press the submit when locale is en-GB and the I change
to de-DE the date has english format.
I hope it is clear the situation, and maybe you have an answer for this.
Thanks.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Promlem-with-date-format-on-changing-locale-tp4383834p4383834.html
Sent from the Users forum 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: Problem with date format on changing locale
Posted by cosmindumy <co...@yahoo.com>.
I actually want to know if I can set date format. I want to set it after
submit.
There is #forDatePattern(...) but this can be used at page initialization,
instead of constructor.
Thnaks.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-date-format-on-changing-locale-tp4383834p4386555.html
Sent from the Users forum 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: Promlem with date format on changing locale
Posted by cosmindumy <co...@yahoo.com>.
I solved it somehow. I used addOrReplace(component) so the date is again
replaced with the format of the new locale. It's not good solution.
Anyway, I have DatePanel that has inside a DateTextField. There is no setter
for converter of Date Text Field. In my case date format is not changed when
I change locale. I have to click on date time picker and after the format is
changed.
Thanks for reply.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-date-format-on-changing-locale-tp4383834p4397196.html
Sent from the Users forum 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: Promlem with date format on changing locale
Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Mon, Feb 13, 2012 at 8:57 AM, cosmindumy <co...@yahoo.com> wrote:
> Hello again,
> I have the following problem. I have a customized DateTimePanel component,
> wich has a DateTextFiled. The problem is that when I change the locale and
> pressing submit the date is not valid anymore due to date format.
> For example I have set the locale de-DE, date looks 02.02.2012 I press
> submit, lets say the validation fails for other reason, when I change the
> locale to en-GB the date is still the german format. I have to choose again
> the date, and now it has the right format. If I don't press submit, when
> changing back to de-DE the date has the german format(even if before was
> english format). If I press the submit when locale is en-GB and the I
> change
> to de-DE the date has english format.
> I hope it is clear the situation, and maybe you have an answer for this.
> Thanks.
>
Please provide code so we can see your custom component and offer
assistance. It seems like your component should pull the locale from the
session - perhaps in onBeforeRender - rather than requiring that it be set
on the component at construction.
--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket? Use Brix! http://brixcms.org*