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

Listheader update issues with invalidatePartial

XMLWordPrintable

    • ZK 9.5.1 S1
    • None

      Steps to Reproduce

      run the code:

      <zk>
          <zscript>
              ListModelList model = new ListModelList(Arrays.asList(new String[] {"A", "B", "C"}));
          </zscript>
          <listbox id="lb" model="${model}" >
              <listhead>
                  <listheader id="lh1" label="col1"/>
              </listhead>
          </listbox>
          <button label="setLabel" onClick='lh1.setLabel("Hello");' />
          <separator/>
          <button label="setLabel + replace model"
                  onClick='lh1.setLabel("Hello"); model.clear(); model.add("replaced");'/>
          <button label="setLabel + clear model"
                  onClick='lh1.setLabel("Hello"); model.clear();'/>
          <button label="setLabel + invalidatePartial"
                  onClick='lh1.setLabel("Hello"); lb.invalidatePartial("rows");'/>
          <separator/>
          <button label="workaround (call invalidate)"
                  onClick='lh1.setLabel("Hello"); model.clear(); lb.invalidate();'/>
      </zk>
      

      1a) click "setLabel + replace model"
      1b) click "setLabel + clear model" (simpler case)
      1c) click "setLabel + invalidatePartial" (isolated case)

      Current Result

      the label of listheader remains the same after each 1st step (1a, 1b, 1c)

      Expected Result

      the label of listheader should be updated after calling setLabel("Hello")

      Debug Information

      "invalidatePartial" will not rerender head rows, only the listitems by design.

      this works when clicking "setLabel" individiually (without "invalidatePartial")

      Workaround

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

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Time Spent - 1 day, 6 hours Remaining Estimate - 1 day, 2 hours
                1d 2h
                Logged:
                Time Spent - 1 day, 6 hours Remaining Estimate - 1 day, 2 hours
                1d 6h