Proposal: remove final modifier for Component#getModel
------------------------------------------------------
Key: WICKET-2601
URL: https://issues.apache.org/jira/browse/WICKET-2601
Project: Wicket
Issue Type: Wish
Components: wicket
Affects Versions: 1.3.4
Reporter: Peter Parson
Priority: Minor
Would be handy, e.g. for labels which are to display different strings
depending on runtime logic.
Ex:
new Label("conditionalLabel") {
public IModel getModel() {
return new StringResourceModel(condition?"mystring.yes":"mystring.no", this,
null);
}
}
Workarounds I can think of are:
* using a PropertyModel, pointing to a getter outside conditionalLabel
* overriding onBeforeRender in order to re-set the model before each time the
component is rendered
Both options do not seem very straightforward to me.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.