putting the size attr on ListChoice vs ListMultipleChoice
---------------------------------------------------------

                 Key: WICKET-19
                 URL: http://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.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to