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

setDisabled() on Listbox doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • 6.0.2
    • None

      I have a zul file, a portion of which looks like this:

      <listbox id="file_attach_list" multiple="true" checkbox="true" sizedByContent="true">
          <listhead>
              <listheader label="File Name"/>
              <listheader label="Size (bytes)"/>
          </listhead>
          <template name="model">
              <listitem>
                  <listcell label="${each.filename}"/>
                  <listcell label="${each.filesize}"/>
              </listitem>
          </template>
      </listbox>
      

      In my controller I have Java like this:

      @Wire("#file_attach_list")
      private Listbox fileAttachList;
      
      private ListModelList<FileAttachModel> attachList = new ListModelList<FileAttachModel>();
      
      @Override
      public void doAfterCompose(Window win) throws Exception {
          super.doAfterCompose(win);
      
          attachList.setMultiple(true);
          fileAttachList.setModel(attachList);
      
          populateList();
      
          disableControls();
      }
      
      /* ... other methods, including one that populates the list */
      
      private void disableControls() {
          fileAttachList.setDisabled(true);
      }
      
      

      When I make a call to disableControls() nothing happens. All of the items are still selectable. I would have expected that the list would become greyed out and none of the items could be selected. Manually iterating over the children of the Listbox should not have to be necessary.

            neillee neillee
            iwagner iwagner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: