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

cannot use array of Class as listbox or grid model

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.6.3
    • Fix Version/s: None
    • Component/s: Components, Databind 2
    • Environment:

      Windows 10, Oracle JDK 1.8.0_201, Tomcat 8.0.47, ZK 8.6.3

      Description

      When using an array of classes as grid or listbox model then the exception

      No public static field named [xxx] was found on class [yyy]

      is thrown. The example below used to work with ZK 7.

      import java.util.Arrays;
      
      public class TestViewModel {
      private final Class<?> classes[] = new Class<?>[] { String.class, Integer.class };
      
      public Class<?>[] getClasses() {
      return Arrays.copyOf(classes, classes.length);
      }
      }
      
      <listbox apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('TestViewModel')"
      model="@load(vm.classes)">
      <template name="model">
      <listitem label="@load(each.name)" />
      </template>
      </listbox>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              benedetti benedetti
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: