Re: ResourceModel vs. getLocalizer

2008-08-19 Thread Erik van Oosten
There is a big difference, the model variant will evaluate during the render phase. You can not use localization in the constructor of your component, you can however safely construct a ResourceModel (but not call getObject on it). In general, I would use localizer when you need direct access to

Re: ResourceModel vs. getLocalizer

2008-08-19 Thread lesterburlap
you can however safely construct a ResourceModel (but not call getObject on it). So, doing ResourceModel(key).getObject().getString() is really kind of silly and defeats the whole purpose of the ResourceModel? LBB -- View this message in context: http://www.nabble.com/ResourceModel-vs

Re: ResourceModel vs. getLocalizer

2008-08-19 Thread Timo Rantalaiho
On Tue, 19 Aug 2008, Erik van Oosten wrote: There is a big difference, the model variant will evaluate during the render phase. You can not use localization in the constructor of your Well, this new ResourceModel(my.resource.key).getObject().toString(); will of course evaluate right away

ResourceModel vs. getLocalizer

2008-08-18 Thread lesterburlap
trying to get a property string during Component construction (to avoid those getLocalizer warnings). But I'm not really sure if my reasoning is good... Thanks for any input. LBB -- View this message in context: http://www.nabble.com/ResourceModel-vs.-getLocalizer-tp19040992p19040992.html Sent

Re: ResourceModel vs. getLocalizer

2008-08-18 Thread Timo Rantalaiho
On Mon, 18 Aug 2008, lesterburlap wrote: new ResourceModel(my.resource.key).getObject().toString(); or getLocalizer().getString(my.resource.key, MyComponent.this); Isn't the latter same as Component.getString(my.resource.key); ? And ResourceModel can typically be used directly as the