Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1328

UISelectOne and UISelectMany fail with custom converter that returns java.lang.String from getAsObject() method.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.4-SNAPSHOT
    • 1.1.5
    • None
    • None

    Description

      The problem seems to be in javax.faces.component._SelectItemsUtil.matchValue(FacesContext context, Object value, Iterator selectItemsIter, _ValueConverter converter) method.

      Line 63-72:
      Object itemValue = item.getValue();
      if(converter != null && itemValue instanceof String)

      { itemValue = converter.getConvertedValue(context, (String)itemValue); }

      if (value==itemValue || value.equals(itemValue))

      { return true; }

      If item's value is java.lang.String then this code does duplicate conversion making matchValue() return false and subsequently resulting in error in calling method (validateValue() in javax.faces.component.UISelectOne and javax.faces.component.UISelectMany).

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mmarinschek Martin Marinschek
            amaslov Alexey Maslov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment