You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Ludwig (JIRA)" <ji...@apache.org> on 2010/07/01 13:30:49 UTC

[jira] Created: (WICKET-2930) Method isSelected in Select should be public

Method isSelected in Select should be public
--------------------------------------------

                 Key: WICKET-2930
                 URL: https://issues.apache.org/jira/browse/WICKET-2930
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
    Affects Versions: 1.4.9
            Reporter: Sven Ludwig


Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.

Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.


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


[jira] Commented: (WICKET-2930) Method isSelected in Select should be public

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917236#action_12917236 ] 

Igor Vaynberg commented on WICKET-2930:
---------------------------------------

i dont understand why you would want to call this method from outside or be able to override it...

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>         Attachments: fix-WICKET-2930.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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


[jira] Updated: (WICKET-2930) Method isSelected in Select should be public

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

Tomasz Dziurko updated WICKET-2930:
-----------------------------------

    Attachment: fix-WICKET-2930.patch

I am attaching fix for this issue. 

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>         Attachments: fix-WICKET-2930.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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


[jira] Commented: (WICKET-2930) Method isSelected in Select should be public

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884256#action_12884256 ] 

Martin Grigorov commented on WICKET-2930:
-----------------------------------------

Cite: "We made the decision to create additional classes around it to support radio buttons."

Workaround: Instead of using reflections you can create a new class (an adapter) with the same package but different class name and this class will extend Wicket's Select just to expose #isSelected(SelectOption) as public. Then your "additional class" (MySelect) will extend the adapter.

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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


[jira] Commented: (WICKET-2930) Method isSelected in Select should be public

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885618#action_12885618 ] 

Juergen Donnerstag commented on WICKET-2930:
--------------------------------------------

would it be able for you to contribute your code to the Wicket project? We are always interested to learn from Wicket users and consider for improvements what they've learnt. Thanks for considering.

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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


[jira] Commented: (WICKET-2930) Method isSelected in Select should be public

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917633#action_12917633 ] 

Igor Vaynberg commented on WICKET-2930:
---------------------------------------

for radio buttons there is RadioGroup and Radio components...why dont those work for what you want?

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>         Attachments: fix-WICKET-2930.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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


[jira] Commented: (WICKET-2930) Method isSelected in Select should be public

Posted by "Sven Ludwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917558#action_12917558 ] 

Sven Ludwig commented on WICKET-2930:
-------------------------------------

We have implemented isSelected ourselves to make the Select work with our own SelectOptions Subclass for radio buttons and check-boxes. Out of the box the Select only works for drop-downs. Our motivation to use the Select for radio-buttons/check-boxes was to be able to define the mark-up for the radio-buttons/check-boxes in an html-template, which is not possible using the Wicket 1.4 RadioChoice.

> Method isSelected in Select should be public
> --------------------------------------------
>
>                 Key: WICKET-2930
>                 URL: https://issues.apache.org/jira/browse/WICKET-2930
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.9
>            Reporter: Sven Ludwig
>         Attachments: fix-WICKET-2930.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Please change the scope of the method isSelected in the class  org.apache.wicket.extensions.markup.html.form.select.Select  to public so that it can be called from elsewhere or even overridden in subclasses elsewhere.
> Background: In our current project we came to the conclusion that the Choice classes of the Wicket core are not suitable to implement panels with radio buttons, where the radio buttons need to be rendered from an EnumSet or from Collection. We particularly needed to be able to define the markup of each option in a template. Moreover we needed to be able to define the CSS classes on the option tag itself. Another requirement was Ajax support, in which the selection of a radio button is immediately submitted to the server. We had a look at the class org.apache.wicket.extensions.markup.html.form.select.Select which we knew was doing a good job for drop-down boxes in the way we needed it. We made the decision to create additional classes around it to support radio buttons. Our approach worked, but we had to use Java Reflection because the crucial method isSelected in the Select class is package local. Will there be changes in the Wicket core or in wicket-extensions to improve the support for radio buttons? I heard that in 1.5 there may be improvements.

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