Uploaded image for project: 'ZATS'
  1. ZATS
  2. ZATS-36

SelectorAgent does not work correctly with combobox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 1.2.0
    • Mimic
    • ZATS 1.2

      SelectorAgent does not work for combobox.
      This is my selector:

      "label[value='dropdownName'] + combobox > comboitem[label='itemLabel']"

      and it correctly resolves the comboboxitem and calls ComboitemSelectAgentBuilder.select()
      And this results in:

      org.zkoss.zats.mimic.impl.EmulatorClient - HTTP response content: {"rs":[],"rid":1}

      After debugging the server-side org.zkoss.zul.Combobox.service(org.zkoss.zk.au.AuRequest request, boolean everError)
      I see that selecting a combobox item actually consist of two events:

      • Events.ON_CHANGE
      • Events.ON_SELECT

      But SelectorAgent sends only the second and so main part of server-side code that is executed in on onChange is not executed.

      This is how my FixedComboitemSelectAgentBuilder does it correctly:

      @Override
      public void select() {
      String desktopId = target.getDesktop().getId();
      Component combobox = getEventTarget();
      String label = (String)(target.as(Comboitem.class).getLabel());

      // post onChange
      InputEvent onChangeEvent = new InputEvent(Events.ON_CHANGE, (Component) target.getDelegatee(), label, null);
      Map<String, Object> onChangeData = EventDataManager.getInstance().build(onChangeEvent);
      ((ClientCtrl) getClient()).postUpdate(desktopId, combobox.getUuid(), onChangeEvent.getName(), onChangeData, false);

      //post onSelect
      Event onSelectEvent = new SelectEvent(Events.ON_SELECT, combobox, new HashSet<String>()add(target.getUuid());,(Component)target.getDelegatee());
      Map<String, Object> onSelectData = EventDataManager.getInstance().build(onSelectEvent);
      ((ClientCtrl) getClient()).postUpdate(desktopId, combobox.getUuid(), onSelectEvent.getName(), onSelectData, false);

      // execute the events
      ((ClientCtrl) getClient()).flush(desktopId);
      }

            Unassigned Unassigned
            m17 m17
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: