You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Parson (JIRA)" <ji...@apache.org> on 2009/09/16 15:29:57 UTC

[jira] Created: (WICKET-2471) Component: set/getEscapeModelStrings should not be final

Component: set/getEscapeModelStrings should not be final
--------------------------------------------------------

                 Key: WICKET-2471
                 URL: https://issues.apache.org/jira/browse/WICKET-2471
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.3.4
            Reporter: Peter Parson


It would be helpful to be able to overwrite getter and setter for escapeModelStrings.

Scenario: custom component with Label inside.
It should be possible to pass CustomComponent#escapeModelStrings property through to Label#escapeModelStrings like this:

@Override
public Component setEscapeModelStrings(boolean escape) {
return myLabel.setEscapeModelStrings(escape);
}

@Override
public boolean getEscapeModelStrings(boolean escape) {
return myLabel.getEscapeModelStrings();
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2471) Component: set/getEscapeModelStrings should not be final

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2471.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

if we make the getter nonfinal then we have to remove the setter because it is easy to break the setter contract by overriding the getter - eg make calls to setescapemodelstrings(false) mean nothing.

you can easily accomplish what you want by using onbeforerender () { label.setescapemodelstrings(getescapemodelstrings()); }


> Component: set/getEscapeModelStrings should not be final
> --------------------------------------------------------
>
>                 Key: WICKET-2471
>                 URL: https://issues.apache.org/jira/browse/WICKET-2471
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.4
>            Reporter: Peter Parson
>            Assignee: Igor Vaynberg
>
> It would be helpful to be able to overwrite getter and setter for escapeModelStrings.
> Scenario: custom component with Label inside.
> It should be possible to pass CustomComponent#escapeModelStrings property through to Label#escapeModelStrings like this:
> @Override
> public Component setEscapeModelStrings(boolean escape) {
> return myLabel.setEscapeModelStrings(escape);
> }
> @Override
> public boolean getEscapeModelStrings(boolean escape) {
> return myLabel.getEscapeModelStrings();
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2471) Component: set/getEscapeModelStrings should not be final

Posted by "Peter Parson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756113#action_12756113 ] 

Peter Parson commented on WICKET-2471:
--------------------------------------

No, unfortunately this does not work in my case, because I've got behaviors dealing with this property, too (which involves getting *and* eventually setting it), and those would have needed to have the property dispatched "real-time" and should not be called either before or afterwards. Well, I'll have to find another solution then, alright.

Regarding to your argument:

I can break quite a lot of contracts when creating a custom component, e.g. breaking the setter contract by overriding set/getVisible is allowed, though?

I do not understand why wicket devs mistrust the framework users so often. After all, we're java developers too, and if we're making silly things, our apps do break, alright - but that should not be a wicket dev's problem. My component, my silly thing, my app, my problem.
In my book, the extensive usage of final in this framework is a big letdown when it comes to talking about extensibility.

By now I've ran into quite some problems because of method being final, often having to do workarounds when there would have been an easy way, or, in the worst cases, duplicating complete wicket classes just to change a few lines because overwriting the specific method did was not possible.

I know this certainly is not a place for discussion, but I would be really happy if the wicket devs could be a little more confident in your users and re-thinked their access modifier policy.

> Component: set/getEscapeModelStrings should not be final
> --------------------------------------------------------
>
>                 Key: WICKET-2471
>                 URL: https://issues.apache.org/jira/browse/WICKET-2471
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.4
>            Reporter: Peter Parson
>            Assignee: Igor Vaynberg
>
> It would be helpful to be able to overwrite getter and setter for escapeModelStrings.
> Scenario: custom component with Label inside.
> It should be possible to pass CustomComponent#escapeModelStrings property through to Label#escapeModelStrings like this:
> @Override
> public Component setEscapeModelStrings(boolean escape) {
> return myLabel.setEscapeModelStrings(escape);
> }
> @Override
> public boolean getEscapeModelStrings(boolean escape) {
> return myLabel.getEscapeModelStrings();
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.