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

Listheader update issues with invalidatePartial

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 9.0.0
    • Fix Version/s: None
    • Component/s: Components
    • Labels:
      None

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: