RE: Dynamic Resources, Properties
No, I was not using a properties file from the filesystem but it is an in memory string (the properties data). The properties data is loaded dynamically when the page is hit. -Original Message- From: Wilhelmsen Tor Iver [mailto:toriv...@arrive.no] Sent: Friday, June 18, 2010 2:29 AM To: users@wicket.apache.org Cc: Berlin Brown Subject: SV: Dynamic Resources, Properties add(new Label(weatherMessage, new StringResourceModel(weather.message, this, null))); If you put a property weather.message into the page's properties file then it will load from there (even if you provide a default in the panel's properties file). Is that what you mean? Properties are only read once no matter where they are resolved from. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic Resources, Properties
Label label = new Label(weatherMessage, new AbstractReadOnlyModelString() { private static final long serialVersionUID = 1L; @Override public String getObject() { if(condition) return SomePanel .this.getString(weather.message); else return SomePanel .this.getString(weather.message1); } }); Ernesto On Thu, Jun 17, 2010 at 9:55 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: I want to be able to use the StringResourceModel, but I want to use a property string that is loaded when the page is loaded. Basically, I want to set a dynamic property object? With this code below, how can I do this. public class SomePanel extends BaseContentPanel { private static final long serialVersionUID = 1L; public SomePanel(String id) { super(id); add(new Label(weatherMessage, new StringResourceModel(weather.message, this, null))); } } Berlin Brown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org