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 IModel<String> with https://issues.apache.org/jira/browse/WICKET-4972 Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Jul 18, 2014 at 7:14 PM, Patrick Davids < patrick.dav...@nubologic.com> wrote: > 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 on getObject() or load() and retrieving my own > Model<String> defaultValue, but everthing is final here, too. > > So, Im not able to achieve this, right now. > > I would like to do this, because I have a dynamic way of giving buttons > a label depending of my Wizard-subclass (have my own > SpecialWizardButtonBar). > > And if a button label is not availabe I want to fallback somewhere, but > the default cannot be a StringResourceModel. > > Can someone help? Or is this a feature request and have to open a ticket? > > kind regards, nice weekend > Patrick