Flavia Paganelli wrote:
> Hi!
>
> Did anyone have to use a Palette component showing the elements in a 
> sorted way (e.g. using a comparator, or the compareTo() method)?
>
> I tried providing a SortedSet to the Palette (a TreeSet), but that 
> doesn't work... The Palette apparently uses its own List internally or 
> something of that kind.
>
> Any ideas or suggestions?
> I looked in the wicket list and found nothing. I sent a mail there also.
>
> Saludos!
>
> Flavia
>   
Well I didn't use this component before, but I can say that it doesn't 
use a different list internally. See the source here:

http://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java

It only calls getModelObject() and casts that to a Collection so an 
ordered list should work

If that doesn't work you can always override 'protected Component 
newChoicesComponent()' to deliver a subclass of Choices in which you 
override 'protected Iterator getOptionsIterator()' to sort the list 
before returning it. Just a suggestion, but I think it should be much 
simpler.

Regards,
Ivo

-- 
Ivo van Dongen
Func. Internet Integration
Prins Hendrikkade 20-21, 1012 TL Amsterdam
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ops-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ops-developers

Reply via email to