Hi Christopher,

Fix looks great, will apply it for the next release.

Thanks.

bob


Christopher Highway (JIRA) wrote:
CountrySelect contains several double items
-------------------------------------------

                 Key: CLK-458
                 URL: http://www.avoka.com:8080/jira/browse/CLK-458
             Project: Click
          Issue Type: Improvement
          Components: extras
    Affects Versions: 1.5 RC2
         Environment: windows /  jdk1.6.0_10 / Apache Tomcat/6.0.18
            Reporter: Christopher Highway
            Priority: Trivial


The net.sf.click.extras.control.CountrySelect field generates a list which 
contains several countries multiple times (Belgium, Canada, Ireland, Japan, 
Luxembourg, Malta, Norway, Singapore, Spain, Switzerland, Thailand, United 
States).

This is because the source used to generate this list 
(Locale.getAvailableLocales()) contains multiple items (when there are 
sublocales).

This can be solved by manually filtering the list, or using a set. I solved it 
using a set.

in CountrySelect Line: 212
original: List optionList = new ArrayList();
new:
        Set optionList = new TreeSet(new OptionLabelComparator(getLocale()));

and removing lines: 223 and 224


Reply via email to