<br><br><div class="gmail_quote">2010/3/29 Martin Marinschek <span dir="ltr"><<a href="mailto:mmarinschek@apache.org">mmarinschek@apache.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Leonardo,<br>
<div class="im"><br>
> Map - The keys of this object (once converted to Strings) are assumed to be<br>
> labels, and the values of this object (once converted to Strings) are<br>
> assumed to<br>
> be values, of SelectItem instances that will be constructed dynamically and<br>
> added to the set of available options for the parent component, in the order<br>
> provided by an iterator over the keys.<br>
<br>
</div>I never understood why the labels should be the key here - it should<br>
really be the other way round, and the value should be the key. I<br>
thought that was sorted for 1.2 - it is not?<br>
<div class="im"><br></div></blockquote><div><br>No, this was not solved because the documentation of f:selectItems does<br>not have the properties mentioned (var, itemValue, itemLabel....). In fact<br>it was f:selectItem the component that has them in jsf 1.2<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
> This behavior comes from jsf 1.1, but in jsf 2.0 it was added some new<br>
> attributes (from f:selectItems tlddoc):<br>
><br>
> Version 2 of the specification introduces several new attributes, described<br>
> below. These are: var, itemValue, itemLabel, itemDescription, itemDisabled,<br>
> and<br>
> itemLabelEscaped.<br>
><br>
> Now, what happen if some user do something like this:<br>
><br>
> <f:selectItems value="#{myMap}" var="item"<br>
> itemLabel="#{item.value.someLabelProperty}" itemValue="#{item.value}"><br>
><br>
> It just does not work, because there is no clear definition about what<br>
> should<br>
> f:selectItems do in this case.<br>
><br>
> The proposal for solve this one is if var property is set and value<br>
> implements<br>
> Map interface, use the entry object as var, so the user can choose between<br>
> the<br>
> key and some attribute on the item value.<br>
<br>
</div>I totally agree - +1 from me.<br>
<br>
best regards,<br>
<font color="#888888"><br>
Martin<br>
</font></blockquote></div><br>