t:selectItems behaviour with Map values is weird ------------------------------------------------
Key: TOMAHAWK-1403 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1403 Project: MyFaces Tomahawk Issue Type: Bug Affects Versions: 1.1.8 Reporter: Simon Kitching The t:selectItems tag documentation says that the value attribute can return a Map, and that a list of select-items is built using the key and value of the map. The docs are completely wrong. This was originally reported by Johannes Ruthenberg here: http://mail-archives.apache.org/mod_mbox/myfaces-users/200903.mbox/%3c49babcd9.6030...@software-friends.de%3e The situation appears to be that: (a) the myfaces f:selectItems tag handles situations where the value is a Map by building a list of SelectItems from the map value/key automatically. This may not be compliant with the JSF specification; I don't know of anywhere that this behaviour is specified. The class that does this is SelectItemsIterator (from myfaces shared library). (b) The tomahawk t:selectItems tag maps to the AbstractUISelectItems component class. This overrides the handling of Map objects by building the SelectItem list itself, which disables the behaviour from (a) as the SelectItemsIterator never sees the Map object. The AbstractUISelectItems custom Map handling does NOT use the map keys when building the SelectItem list, ie its behaviour is quite different from what SelectItemsIterator does for maps. It does make it possible to do some other things when building the SelectItems list, but using the map key is impossible. It would be nice to know whether behaviour (a) is also implemented in Mojarra. If that behaviour is also in Mojarra, then it would be nice for t:selectItems to be able to behave in a compatible manner. At the least, the t:selectItems documentation needs to be updated in tomahawk/core/src/main/tagdoc/t_selectItems-base.xml The custom Map handling in AbstractUISelectItems was originally added by Cagatay. It is not clear where the wrong documentation came from, but that is more recent. See the email thread for more details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.