You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2010/10/24 12:27:25 UTC
[jira] Commented: (WICKET-2776) Enhancing RadioChoice input items
with individual title and css class attributes
[ 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.