Re: How to set wicket's locale?
I'm planing to have a little celebration in our office when our webapp is officially released to customers. I was thinking about ordering pizza to be delivered to the wicket developers who have helped us so much here on the list, so they can share our joy, not just our problems. How hard can it be to order pizza online in any language, I thought. But sushi is probably a bit more tricky, and you miss all the atmosphere if you just have it delivered, so I might have to ask you guys to go out to have some, and send us the bill :-) Gabor On 9/6/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > can you send some over? > > On 9/6/07, Evan Chooly <[EMAIL PROTECTED]> wrote: > > > > T-37 minutes until sushi time! > > > > On 9/6/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > sushi > > > > > > > > > -igor > > > > > > > > > On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > > > > > > > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > > > > > > > ? > > > > > > > > > > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > > > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > > > > can you make an jira issue for this? > > > > > > > > > > https://issues.apache.org/jira/browse/WICKET-936 > > > > > > > > > > Any ideas on encapsulating the session as a propertymodel for > > > components > > > > in 1.2? > > > > > > > > > > > > > > > Gabor > > > > > > > > > > > > - > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > -- > > > > Buy Wicket in Action: http://manning.com/dashorst > > > > Apache Wicket 1.3.0-beta3 is released > > > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
can you send some over? On 9/6/07, Evan Chooly <[EMAIL PROTECTED]> wrote: > > T-37 minutes until sushi time! > > On 9/6/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > sushi > > > > > > -igor > > > > > > On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > > > > > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > > > > > ? > > > > > > > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > > > can you make an jira issue for this? > > > > > > > > https://issues.apache.org/jira/browse/WICKET-936 > > > > > > > > Any ideas on encapsulating the session as a propertymodel for > > components > > > in 1.2? > > > > > > > > > > > > Gabor > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > Buy Wicket in Action: http://manning.com/dashorst > > > Apache Wicket 1.3.0-beta3 is released > > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > >
Re: How to set wicket's locale?
you suck! -igor On 9/6/07, Evan Chooly <[EMAIL PROTECTED]> wrote: > > T-37 minutes until sushi time! > > On 9/6/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > sushi > > > > > > -igor > > > > > > On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > > > > > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > > > > > ? > > > > > > > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > > > can you make an jira issue for this? > > > > > > > > https://issues.apache.org/jira/browse/WICKET-936 > > > > > > > > Any ideas on encapsulating the session as a propertymodel for > > components > > > in 1.2? > > > > > > > > > > > > Gabor > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > Buy Wicket in Action: http://manning.com/dashorst > > > Apache Wicket 1.3.0-beta3 is released > > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > >
Re: How to set wicket's locale?
T-37 minutes until sushi time! On 9/6/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > sushi > > > -igor > > > On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > > > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > > > ? > > > > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > > can you make an jira issue for this? > > > > > > https://issues.apache.org/jira/browse/WICKET-936 > > > > > > Any ideas on encapsulating the session as a propertymodel for > components > > in 1.2? > > > > > > > > > Gabor > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > Buy Wicket in Action: http://manning.com/dashorst > > Apache Wicket 1.3.0-beta3 is released > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
Re: How to set wicket's locale?
sushi -igor On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > ? > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > can you make an jira issue for this? > > > > https://issues.apache.org/jira/browse/WICKET-936 > > > > Any ideas on encapsulating the session as a propertymodel for components > in 1.2? > > > > > > Gabor > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Buy Wicket in Action: http://manning.com/dashorst > Apache Wicket 1.3.0-beta3 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: How to set wicket's locale?
On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > new PropertyModel(Page.this, "session.foo.sushi.bar"); > > ? Wow. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
new PropertyModel(Page.this, "session.foo.sushi.bar"); ? On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > can you make an jira issue for this? > > https://issues.apache.org/jira/browse/WICKET-936 > > Any ideas on encapsulating the session as a propertymodel for components in > 1.2? > > > Gabor > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-beta3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > can you make an jira issue for this? https://issues.apache.org/jira/browse/WICKET-936 Any ideas on encapsulating the session as a propertymodel for components in 1.2? Gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
can you make an jira issue for this? On 9/4/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > Uh, oh, one more quick thing: > > I'm still on wicket 1.2, and my wicket:message labels retain their > text in the locale they were first rendered in. > > Is there anything I can do on locale changes to make them change their > text? > > Is this behavior the same under 1.3? > > > Gabor > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: How to set wicket's locale?
Uh, oh, one more quick thing: I'm still on wicket 1.2, and my wicket:message labels retain their text in the locale they were first rendered in. Is there anything I can do on locale changes to make them change their text? Is this behavior the same under 1.3? Gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
On 9/3/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > Just go with overriding getLocale on your custom session object. If > you need to support just one locale, that's easy: just always let it > return that locale. Otherwise, you'll have to do some more work (e.g. > using request.getLocale()), but it shouldn't be very difficult. Hardcoding a locale was just an experiment, but I might end up using it :-) I'd like your input on where my SessionModel approach goes wrong? Gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
> Thanks for the support and ideas. > But for the record: > Overriding getLocale() would surely work, but sounds like even worse > of a hack than setLocale(_) No, if you override it, it will *always* return the value you provide. The locale member obviously wouldn't be use unless you yourself use it. , and when I set the locale in the > ISessionFactory it gets reset by the locale in the request just like > when I set it in the session constructor. (which is to be expected, > really.) Yeah, sorry about that. Forgot that that was a mess to start with (which is why we refactored it). Just go with overriding getLocale on your custom session object. If you need to support just one locale, that's easy: just always let it return that locale. Otherwise, you'll have to do some more work (e.g. using request.getLocale()), but it shouldn't be very difficult. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
On 9/3/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > I use wicket 1.2 for now. > > Yeah, unfortunately it doesn't work for 1.2. It's one of the > improvements for 1.3. We'll upgrade for the next release once this one is out... > But either override getLocale in your session, or set it using a > custom session factory. Thanks for the support and ideas. But for the record: Overriding getLocale() would surely work, but sounds like even worse of a hack than setLocale(_), and when I set the locale in the ISessionFactory it gets reset by the locale in the request just like when I set it in the session constructor. (which is to be expected, really.) Here's my current plan to manage the locale (and to display the logged in user while I'm at it), please tell me what's wrong with it, I get an exception about the model being a null object: public class DetachableSessionModel extends LoadableDetachableModel { @Override protected Object load() { return Session.get(); } } public class LocalePanel extends MCCNPanel { public LocalePanel(String id) { super(id); Form form = new Form("form"); add(form); form.setModel(new DetachableSessionModel()); List locales = new Vector(); locales.add(new Locale("hu")); locales.add(new Locale("sr")); locales.add(CentrexSession.get().getLocale()); form.add(new DropDownChoice("locale", locales, new ChoiceRenderer("language", "language") )); form.add(new Button("submit")); } } When I submit: java.lang.IllegalStateException: Attempt to set model object on null model of component: topLeftPanel:form:locale at wicket.Component.setModelObject(Component.java:2013) at wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:840) at wicket.markup.html.form.Form$11.formComponent(Form.java:923) at wicket.markup.html.form.Form$4.component(Form.java:465) at wicket.MarkupContainer.visitChildren(MarkupContainer.java:744) at wicket.markup.html.form.Form.visitFormComponents(Form.java:461) at wicket.markup.html.form.Form.updateFormComponentModels(Form.java:914) at wicket.markup.html.form.Form.process(Form.java:896) at wicket.markup.html.form.Form.onFormSubmitted(Form.java:310) at java.lang.reflect.Method.invoke(Method.java:597) at wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:187) at wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:74) at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65) at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57) at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896) at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929) at wicket.RequestCycle.step(RequestCycle.java:1010) at wicket.RequestCycle.steps(RequestCycle.java:1084) at wicket.RequestCycle.request(RequestCycle.java:454) at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219) at wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:262) at javax.servlet.http.HttpServlet.service(HttpServlet.java:738) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(Defaul
Re: How to set wicket's locale?
> I use wicket 1.2 for now. Yeah, unfortunately it doesn't work for 1.2. It's one of the improvements for 1.3. But either override getLocale in your session, or set it using a custom session factory. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
with 1.2 you can have your session factory and after you created the session call setLocale On 9/3/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote: > > On 8/22/07, Nino Saturnino Martinez Vazquez Wael > <[EMAIL PROTECTED]> wrote: > > There are some different approaches you could use... > > > > But why not make a parent page class where you do it in? And then > > inherit from that? Or just use a custom session which does it by it > > self(check out the quickstart project to see how to create a session > class). > > > I saved this message from a few weeks ago, and I finally got around to > localize my application. > > I use wicket 1.2 for now. > > I extended the wicket.WebSession class, and set the locale in its > constructor, just to see if it works. > It does not: the request overrides my setting, so I get my pages in > the language I configured the browser to prefer. > I do not want this, think internet cafes or locked down corporate > machines. > I can't override setLocale/1 to disable this feature, because it is > declared final in wicket.Session. > So what is the wicket way to make my application ignore the locale in > the request? > > > Thanks in advance, and thanks for the great framework! > > Gabor > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: How to set wicket's locale?
Why don't you just: @Override public Locale getLocale() { return Locale.ENGLISH; } ? > -Original Message- > From: Gabor Szokoli [mailto:[EMAIL PROTECTED] > Sent: 3 September 2007 21:04 > To: users@wicket.apache.org > Subject: Re: How to set wicket's locale? > > > On 8/22/07, Nino Saturnino Martinez Vazquez Wael > <[EMAIL PROTECTED]> wrote: > > There are some different approaches you could use... > > > > But why not make a parent page class where you do it in? And then > > inherit from that? Or just use a custom session which does it by it > > self(check out the quickstart project to see how to create a > session class). > > > I saved this message from a few weeks ago, and I finally got around to > localize my application. > > I use wicket 1.2 for now. > > I extended the wicket.WebSession class, and set the locale in its > constructor, just to see if it works. > It does not: the request overrides my setting, so I get my pages in > the language I configured the browser to prefer. > I do not want this, think internet cafes or locked down corporate > machines. > I can't override setLocale/1 to disable this feature, because it is > declared final in wicket.Session. > So what is the wicket way to make my application ignore the locale in > the request? > > > Thanks in advance, and thanks for the great framework! > > Gabor > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
On 8/22/07, Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]> wrote: > There are some different approaches you could use... > > But why not make a parent page class where you do it in? And then > inherit from that? Or just use a custom session which does it by it > self(check out the quickstart project to see how to create a session class). I saved this message from a few weeks ago, and I finally got around to localize my application. I use wicket 1.2 for now. I extended the wicket.WebSession class, and set the locale in its constructor, just to see if it works. It does not: the request overrides my setting, so I get my pages in the language I configured the browser to prefer. I do not want this, think internet cafes or locked down corporate machines. I can't override setLocale/1 to disable this feature, because it is declared final in wicket.Session. So what is the wicket way to make my application ignore the locale in the request? Thanks in advance, and thanks for the great framework! Gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
There are some different approaches you could use... But why not make a parent page class where you do it in? And then inherit from that? Or just use a custom session which does it by it self(check out the quickstart project to see how to create a session class). regards Nino smithfox wrote: I have solved the problem with your help.:jumping: Thanks But I must set locale in every Page java class. Is there a uniform configuration to set it? Eelco Hillenius wrote: On 8/21/07, Johan Compagner <[EMAIL PROTECTED]> wrote: then you browser tells wicket that it should use English . But you can set it yourself: Session.setLocale() Or if for instance you want to fix the locale to always use a certain one, use a custom session and set the locale it's constructor. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
I have solved the problem with your help.:jumping: Thanks But I must set locale in every Page java class. Is there a uniform configuration to set it? Eelco Hillenius wrote: > > On 8/21/07, Johan Compagner <[EMAIL PROTECTED]> wrote: >> then you browser tells wicket that it should use English . >> But you can set it yourself: Session.setLocale() > > Or if for instance you want to fix the locale to always use a certain > one, use a custom session and set the locale it's constructor. > > Eelco > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-set-wicket%27s-locale--tf4309547.html#a12269046 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
On 8/21/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > then you browser tells wicket that it should use English . > But you can set it yourself: Session.setLocale() Or if for instance you want to fix the locale to always use a certain one, use a custom session and set the locale it's constructor. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set wicket's locale?
then you browser tells wicket that it should use English . But you can set it yourself: Session.setLocale() johan On 8/22/07, smithfox <[EMAIL PROTECTED]> wrote: > > > I used RequiredTextField, when the field is empty, the feedback show some > meesage in English, How to change it to Chinese. > -- > View this message in context: > http://www.nabble.com/How-to-set-wicket%27s-locale--tf4309547.html#a12268483 > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
How to set wicket's locale?
I used RequiredTextField, when the field is empty, the feedback show some meesage in English, How to change it to Chinese. -- View this message in context: http://www.nabble.com/How-to-set-wicket%27s-locale--tf4309547.html#a12268483 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]