Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2292

field access using dot notation (a.b.c) is not fully consistent for maps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.3
    • None
    • Databind
    • None

      org.zkoss.lang.reflect.Fields.get/set() does not directly support maps.

      org.zkoss.zkplus.databind.Databinding.fetchValue() has some workaround like

      if (bean instanceof Map)
      bean = ((Map)bean).get(nodeid);
      else
      bean = Fields.get(bean, nodeid);

      But other classes do not have this workaround, e.g. FieldComparator
      Therefore <listheader sort="auto(keyMap.2.value)" /> does not work.

      I would suggest to support map access directly within Fields.get/set() methods!
      This would provide a consistent behavior for databinding + sorting + etc.

      Please see patched class org.zkoss.lang.reflect.Fields to get more details.

            jumperchen jumperchen
            fse fse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: