Is there some obvious way to add a separator to the list of options in a Wicket DropDownChoice? In my case I'm populating the selection with two types of domain objects from my datasource. I guess I could go and manually add some kind of dummy domain object to the choice list but it feels pretty ugly.
Example:
+---------+-+
| Apple |▼|
| Orange +-+
| ------- |
| Carrot |
| Cucumber|
+---------+
Current code (without any separator) looks something like:
EntityModel model = getModel();
List<? extends Produce> foods = foodService.getAllProduce();
// getAllProduce() returns first all fruits, then all vegetables
add(new DropDownChoice<Produce>(
"produceSelect", new PropertyModel<Produce>(model, "favProduce"), foods)
);
See Question&Answers more detail:os