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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.3
    • Component/s: Databind
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: