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

listbox onSelect can't reference any component or variables : Attempt to resolve method undefined variable or class name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 6.5.1, 6.5.2, 6.5.3, 7.0.1
    • Components
    • Glassfish 3.1 / Chrome web browser / zk PE 7.0.1

      When trying to run the custom_combobox example from zklive website , I always get an error when I try to select an item in the listbox, included into a bandbox.

      here is the example

      <?page title="new page title" contentType="text/html;charset=UTF-8"?>
      <zk>
      <bandbox id="x" name="x">
      <bandpopup>
      <listbox id="list" width="200px" onSelect="x.setValue(self.getSelectedItem().getLabel());x.close()" name="list">
      <listhead>
      <listheader label="Name" />
      <listheader label="Description" />
      </listhead>
      <listitem>
      <listcell label="John" />
      <listcell label="CEO" />
      </listitem>
      <listitem>
      <listcell label="Joe" />
      <listcell label="Engineer" />
      </listitem>
      <listitem>
      <listcell label="Mary" />
      <listcell label="Supervisor" />
      </listitem>
      </listbox>
      </bandpopup>
      </bandbox>
      </zk>

      here is the error on selection:

      Sourced file: inline evaluation of: `` x.setValue(self.getSelectedItem().getLabel());x.close();'' : Attempt to resolve method: getSelectedItem() on undefined variable or class name: self : at Line: 5 : in file: inline evaluation of: `` x.setValue(self.getSelectedItem().getLabel());x.close();'' : self .getSelectedItem ( )

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

              Created:
              Updated:
              Resolved: