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

cannot use array of Class as listbox or grid model

    XMLWordPrintable

Details

    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

              rudyhuang rudyhuang
              benedetti benedetti
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h