You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2009/03/16 08:34:50 UTC

[jira] Commented: (TOMAHAWK-1403) t:selectItems behaviour with Map values is weird

    [ https://issues.apache.org/jira/browse/TOMAHAWK-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682234#action_12682234 ] 

Leonardo Uribe commented on TOMAHAWK-1403:
------------------------------------------


Comparing the component available in tomahawk version 1.1.6 and 1.1.8 with a diff tool this changes are found:

1. Usage of abstract pattern on component
2. getter and setter for var, itemLabel and itemValue now are generated
3. save and restore state are generated

The code related to map handling is the same in both versions.

About the documentation, the svn log says:

revision 672986 fix documentation comments.

With myfaces-builder-plugin it is possible to create a tag documentation report (the intention of this tool is make easier maintain documentation for tomahawk). Some files in src/site/apt and src/site/xdoc where merged with current code (that's where the comment of handle Maps came from). The idea is that all documentation should be in one place and additional stuff like graphics, examples and others should be in src/main/tagdoc.

Maybe the original intention was handle Maps, but it was never tested fully. So this is a good moment to define what behavior should be implemented.



> 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.6030702@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.