myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Mahoney (JIRA)" <>
Subject [jira] Created: (TOMAHAWK-181) Picklist does not support non-string values
Date Tue, 07 Mar 2006 17:00:38 GMT
Picklist does not support non-string values

         Key: TOMAHAWK-181
     Project: MyFaces Tomahawk
        Type: Bug
    Versions: 1.1.2-SNAPSHOT    
    Reporter: Peter Mahoney

The method selectItemsForSelectedList() in HtmlPicklistRenderer currently compares the value
of the SelectItem with the value from the lookup set, which will always be a string.

Converting the SelectItem value to a string before the comparison solves the problem. The
method becomes:

    private List selectItemsForSelectedList(FacesContext facesContext,
                                            UIComponent uiComponent, List selectItemList,
Converter converter,
                                            Set lookupSet)
        List selectItemForSelectedValues = new ArrayList(lookupSet.size());

        for (Iterator i = selectItemList.iterator(); i.hasNext();)
            //set.add( RendererUtils.getConvertedStringValue(facesContext, uiComponent, converter, );
            SelectItem selectItem = (SelectItem);

// Convert the item value to a string
            String itemStrValue = RendererUtils.getConvertedStringValue(facesContext, uiComponent,
                    converter, selectItem);
            for (Iterator i2 = lookupSet.iterator(); i2.hasNext();)
                Object value =;

// Compare the lookup value with the string
                if (value.equals(itemStrValue))

        return selectItemForSelectedValues;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message