Re: StringResourceModel with a defaultValue as model

2014-07-21 Thread Patrick Davids
Hi François, what I try to do is a bit different... I would like to provide a default per component sub-class, before wicket cascades the property files up to application.properties. Something like this: add(new Label(, new StringResourceModel(key.${someInfoFromBean}, Component.this,

Re: StringResourceModel with a defaultValue as model

2014-07-21 Thread Martin Grigorov
On Mon, Jul 21, 2014 at 10:39 AM, Patrick Davids patrick.dav...@nubologic.com wrote: Hi François, what I try to do is a bit different... I would like to provide a default per component sub-class, before wicket cascades the property files up to application.properties. Something like this:

[SOLVED] Re: StringResourceModel with a defaultValue as model

2014-07-21 Thread Patrick Davids
Yes, already implemented this way. :-) Added a todo now, waiting for wicket7 to improve it. Thanx for the hint anyway... regards Patrick For now you can workaround it with: add(new Label(, new StringResourceModel(key.${someInfoFromBean}, Component.this, Model.of(anyBean), new

Re: StringResourceModel with a defaultValue as model

2014-07-19 Thread Martin Grigorov
Hi, There is a defaultValue already. org.apache.wicket.model.StringResourceModel#StringResourceModel(java.lang.String, org.apache.wicket.Component, org.apache.wicket.model.IModel?, *java.lang.String*, java.lang.Object...) In Wicket 7 the API is changed to IModelString with

StringResourceModel with a defaultValue as model

2014-07-18 Thread Patrick Davids
Hi all, is there any way to implement a StringResourceModel which allows to give a defaultValue as model? First I tried to override getDefaultModelAsString() of Label. (is final) Than I tried to implement an extending ModeledDefaultValueStringResourceModel, catching a MissingResourceException

Re: StringResourceModel with a defaultValue as model

2014-07-18 Thread Francois Meillet
In your Application.properties you add the key key.to.be.good=theValue and you can use the StringResourceModel like that add( new Label(, new StringResourceModel(key.to.be.good, null))); François Meillet Formation Wicket - Développement Wicket Le 18 juil. 2014 à 18:14, Patrick Davids