You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2009/12/09 06:05:18 UTC

[jira] Resolved: (WICKET-2601) Proposal: remove final modifier for Component#getModel

     [ https://issues.apache.org/jira/browse/WICKET-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2601.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

doesnt make sense? why have an indirection for a model which is already itself an indirection.

> 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
>            Assignee: Igor Vaynberg
>            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.