You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Szádeczky-Kardoss Szabolcs (JIRA)" <ji...@apache.org> on 2010/03/11 11:16:27 UTC

[jira] Created: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

Enhancing RadioChoice input items with individual title and css class attributes
--------------------------------------------------------------------------------

                 Key: WICKET-2776
                 URL: https://issues.apache.org/jira/browse/WICKET-2776
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.4.7
            Reporter: Szádeczky-Kardoss Szabolcs
            Priority: Minor


Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
Changes in method onComponentTagBody(...)
                ...
                // Add radio tag
                String title = getTitle(index, choice);
                String cssClass = getCssClass(index, choice);
                buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
                if (title != null)
                    buffer.append(" title=\"").append(title).append("\"");
                if (cssClass != null)
                    buffer.append(" class=\"").append(cssClass).append("\"");
                buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
                buffer.append((enabled ? "" : " disabled=\"disabled\""));
                buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
                        .append("\"");
                ...
Added two new methods:
    /**
     * Returns the title attribute to be output for the input tag with the given index and choice
     * value. By default this returns null, and so the title attribute won't be set, but this can be
     * overridden.
     * 
     * @param index
     * @param choice
     * @return title attribute to be used for the given input tag
     */
    protected String getTitle(int index, T choice) {
        return null;
    }

    /**
     * Returns the CSS class attribute to be output for the input tag with the given index and
     * choice value. By default this returns null, and so the class attribute won't be set, but this
     * can be overridden.
     * 
     * @param index
     * @param choice
     * @return CSS class attribute to be used for the given input tag
     */
    protected String getCssClass(int index, T choice) {
        return null;
    }


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


[jira] Closed: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

Posted by "Szádeczky-Kardoss Szabolcs (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Szádeczky-Kardoss Szabolcs closed WICKET-2776.
----------------------------------------------

    Resolution: Fixed

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.8, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Commented: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

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

Hudson commented on WICKET-2776:
--------------------------------

Integrated in Apache Wicket 1.5.x #449 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/449/])
    WICKET-2776 Enhancing RadioChoice input items with individual title and css class attributes

Merge from 1.4.x:
and WICKET-2772
Issue: WICKET-2776
Files Changed
MODIFY /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java

ASF	#922649	Sat Mar 13 13:50:47 EST 2010	jdonnerstag	 added additional attributes to allow for index dependent attributes
Issue: WICKET-2776
Files Changed
MODIFY /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java


> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.13, 1.5-M1, 1.5-M3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Resolved: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

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

Juergen Donnerstag resolved WICKET-2776.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M1
                   1.4.8
         Assignee: Juergen Donnerstag

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.8, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Resolved: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

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

Martin Grigorov resolved WICKET-2776.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.4.8)
                   1.5-M3
                   1.4.13

Merged to 1.5.x with r1026755.
The code could be re-worked as Juergen mentioned in the previous comment in a different ticket. 

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.13, 1.5-M3, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Commented: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

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

Juergen Donnerstag commented on WICKET-2776:
--------------------------------------------

applied to 1.4

I think in 1.5 the code should be reword to use a Compoent rather than hand-made markup

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.8, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Reopened: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

Posted by "Szádeczky-Kardoss Szabolcs (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Szádeczky-Kardoss Szabolcs reopened WICKET-2776:
------------------------------------------------


Hi,
I am not sure whether this is intentional or by accident, but this fix is gone from 1.5-M2.1, so currently there is no
protected IValueMap getAdditionalAttributes(final int index, final T choice)
method present, nor anything similar as far as I seen. Or am I missing something?
Szabolcs

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.8, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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


[jira] Reopened: (WICKET-2776) Enhancing RadioChoice input items with individual title and css class attributes

Posted by "Szádeczky-Kardoss Szabolcs (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Szádeczky-Kardoss Szabolcs reopened WICKET-2776:
------------------------------------------------


Hi Jürgen,

thanks for the quick fix. However the change you have applied doesn't allow to use different attributes for the different choices. This would be especially useful for the title attribute where you definitely want different tooltip text for the different input tags/choices. If you could add an (int index, T choice) or at least (int index) argument to getAdditionalAttributes that would solve the issue completely. Thanks:

Szabolcs

> Enhancing RadioChoice input items with individual title and css class attributes
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-2776
>                 URL: https://issues.apache.org/jira/browse/WICKET-2776
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Szádeczky-Kardoss Szabolcs
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.8, 1.5-M1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Wicket is a great framework based on an excellent idea. It is a joy to work with. There are several existing components and most of them are very usable and customizable as much as possible, however there are still a few places for improvement. One of those is org.apache.wicket.markup.html.form.RadioChoice, where it is currently not possible to set HTML title and class attributes for the individual input tags. This would be a great feature for some client-side javascript frameworks, and in my case the JQuery star-rating plugin is even hard to use without these. For this purpose I have created my own private alternative for this component, but it would be good to have it included in wicket, so that others can benefit too.
> See below the changes I have performed to enable this feature! Please note that all changes are made so that current behavior is not changed only new optional behavior is added.
> Changes in method onComponentTagBody(...)
>                 ...
>                 // Add radio tag
>                 String title = getTitle(index, choice);
>                 String cssClass = getCssClass(index, choice);
>                 buffer.append("<input name=\"").append(getInputName()).append("\" type=\"radio\"");
>                 if (title != null)
>                     buffer.append(" title=\"").append(title).append("\"");
>                 if (cssClass != null)
>                     buffer.append(" class=\"").append(cssClass).append("\"");
>                 buffer.append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""));
>                 buffer.append((enabled ? "" : " disabled=\"disabled\""));
>                 buffer.append(" value=\"").append(id).append("\" id=\"").append(idAttr)
>                         .append("\"");
>                 ...
> Added two new methods:
>     /**
>      * Returns the title attribute to be output for the input tag with the given index and choice
>      * value. By default this returns null, and so the title attribute won't be set, but this can be
>      * overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return title attribute to be used for the given input tag
>      */
>     protected String getTitle(int index, T choice) {
>         return null;
>     }
>     /**
>      * Returns the CSS class attribute to be output for the input tag with the given index and
>      * choice value. By default this returns null, and so the class attribute won't be set, but this
>      * can be overridden.
>      * 
>      * @param index
>      * @param choice
>      * @return CSS class attribute to be used for the given input tag
>      */
>     protected String getCssClass(int index, T choice) {
>         return null;
>     }

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