ICEfaces
  1. ICEfaces
  2. ICE-9560

Converter issues in ACE autocomplete and selection components

    Details

      Description

      ace:autoCompleteEntry, ace:comboBox, ace:selectMenu, and ace:simpleSelectOneMenu have some flaws in the way they handle conversion.

      These components need to convert the values in option items when rendering their lists of results. This is to support complex objects being converted to a string and vice versa. When the values are plain strings or objects that translate easily to a string, there are usually no issues, but when using a custom object as the value, the conversion might not go as expected.

      In short, all rendered values (not labels) of option items need to go through conversion from object to string at render time. The current value of the component will have to go through the same process. After decoding, the Renderer superclass methods can handle properly the conversion from string to object, so we don't have to interfere or override those methods.

        Issue Links

          Activity

          Hide
          Arturo Zambrano added a comment -

          Committed fixes to trunk at revision 37712 and to p01 tag at revision 37713.

          Show
          Arturo Zambrano added a comment - Committed fixes to trunk at revision 37712 and to p01 tag at revision 37713.
          Hide
          Arturo Zambrano added a comment -

          Linking to ICE-9564 to track the validation issue with ace:simpleSelectOneMenu.

          Show
          Arturo Zambrano added a comment - Linking to ICE-9564 to track the validation issue with ace:simpleSelectOneMenu.
          Hide
          Denis Utkin added a comment -

          Found error in SimpleSelectOneMenuRenderer.populateList():

          if (!selectedFound && value != null && value.toString().equals((String) itemValue))

          { selected = " selected=\"selected\""; selectedFound = true; }

          value should be converted by getConvertedValueForClient(), not by simple toString(). Currently it's impossible to update selected value from the bean for lookups containing objects.

          Show
          Denis Utkin added a comment - Found error in SimpleSelectOneMenuRenderer.populateList(): if (!selectedFound && value != null && value.toString().equals((String) itemValue)) { selected = " selected=\"selected\""; selectedFound = true; } value should be converted by getConvertedValueForClient(), not by simple toString(). Currently it's impossible to update selected value from the bean for lookups containing objects.
          Hide
          Arturo Zambrano added a comment -

          Denis,

          Thank you for your tip. That issue is now fixed as part of ICE-9564.

          Show
          Arturo Zambrano added a comment - Denis, Thank you for your tip. That issue is now fixed as part of ICE-9564 .

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Arturo Zambrano
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: