You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org> on 2007/04/26 00:48:17 UTC
[jira] Commented: (WICKET-19) putting the size attr on ListChoice
vs ListMultipleChoice
[ https://issues.apache.org/jira/browse/WICKET-19?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491826 ]
Jean-Baptiste Quenot commented on WICKET-19:
--------------------------------------------
What is the purpose of doing Math.min(maxRows, getChoices().size())? Is that really useful?
> putting the size attr on ListChoice vs ListMultipleChoice
> ---------------------------------------------------------
>
> Key: WICKET-19
> URL: https://issues.apache.org/jira/browse/WICKET-19
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.2
> Environment: JDK 1.5.0_07
> Reporter: Chuck Deal
> Priority: Minor
>
> In working with both ListChoice and ListMultiple choice, the two components are not consistent when applying the size attr. ListMultipleChoice has a better approach.
> from ListMultipleChoice:
> protected final void onComponentTag(final ComponentTag tag)
> {
> super.onComponentTag(tag);
> tag.put("multiple", "multiple");
>
> if (!tag.getAttributes().containsKey("size"))
> {
> tag.put("size", Math.min(maxRows, getChoices().size()));
> }
> }
> This is better for extension purposes because the method is final. It won't blindly set the size attr as it does on ListChoice. Actually, the real change that I want is the value that gets applied to the attr in ListMultipleChoice. But, by adjusting the code to include a check for the attr first, I could attach a behavior to modify the size attr instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.