Using Map<String, MyObject> in a selectOneMenu  XML
Forum Index -> Components
Author Message

Joined: 27/Nov/2006 00:00:00
Messages: 332

Hi there!
I'm using IceFaces 1.6.2 and I found the following problem (if it is at all a problem):
1. I have this class Branch and I want the user to be able to select it from a combo box.
2. For some reasons I chose to use f:selectItems passing it a TreeMap<String (the label), Branch (the actual value)> and I also created a BranchConverter.
3. After fighting for half a day trying to make it work, I took a look at the com.icesoft.faces.renderkit.dom_html_basic.MenuRenderer class, where I found something strange (in my opinion): If I try to use a Map to populate a selectXxxxMenu, then the <key,value> pairs are transformed into a ArrayList<SelectItem> by adding new SelectItem(key.toString(), value.toString()).
In case the problem is not so obvious .... the converter is not called at this point, but only later, when all they receive is branch.toString() and not the "branch" itself.

Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team