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

listbox issues with invalidatePartial

    XMLWordPrintable

    Details

    • gh.sprint.customfield.default.name:
      ZK 9.0.1 S1

      Description

      Steps to Reproduce

      run the code:

      <zk>
          <zscript>
              ListModelList model = new ListModelList(Arrays.asList(new String[] {"A", "B", "C"}));
          </zscript>
          <custom-attributes org.zkoss.zul.listbox.rod="false"/>
          <listbox id="lb" model="${model}" >
              <listhead>
                  <listheader label="col1"/>
              </listhead>
          </listbox>
          <button label="hide" onClick="lb.setVisible(false);"/>
          <button label="show" onClick="lb.setVisible(true);"/>
          <separator/>
          <button label="show + replace model"
                  onClick='lb.setVisible(true); model.clear(); model.add("replaced");'/>
          <button label="show + clear model"
                  onClick='lb.setVisible(true); model.clear();'/>
          <button label="show + invalidatePartial"
                  onClick='lb.setVisible(true); lb.invalidatePartial("rows");'/>
          <separator/>
          <button label="workaround (call invalidate)"
                  onClick='lb.setVisible(true); model.clear(); lb.invalidate();'/>
      </zk>
      

      1) click "hide" (hides listbox)
      2a) click "show + replace model"
      2b) click "show + clear model" (simpler case)
      2c) click "show + invalidatePartial" (isolated case)

      Current Result

      the listbox remains invisible after each 2nd step (2a, 2b, 2c)

      Expected Result

      listbox should become visible after calling setVisible(true)

      Debug Information

      the AuResponse is missing the command to change the visibility, when "invalidatePartial" is triggered

      e.g.: ["setAttr", [{$u: "kJxP0"}, "visible", true]]

      this works when clicking "hide" -> "show" individiually (without "invalidatePartial")

      Workaround

      call listbox.invalidate() manually to trigger a full component rerender

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              cor3000 cor3000
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours
                  1d 4h