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

Searchbox doesn't render items for a ListModelList change in an onOpen listener

    XMLWordPrintable

    Details

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

      Description

      Steps to Reproduce

          <zscript><![CDATA[
              ListModelList dataModel = new ListModelList();
      
          public void load(OpenEvent e){
              if (e.isOpen() && dataModel.size()==0){
                  dataModel.add("item1");
                  dataModel.add("item2");
              }
          }
          public void load(){
              if (dataModel.size()==0){
                  dataModel.add("item1");
                  dataModel.add("item2");
                  }
          }
          ]]></zscript>
          <searchbox model="${dataModel}"  onOpen="load(event)"/>
          <searchbox model="${dataModel}"  onSearching="load()"/>
      

      1. open the first searchbox,
      or type "item" in the 2nd searchbox

      Current Result

      For both cases, no item rendered

      Expected Result

      2 items rendered

      Debug Information

      • The use case is: an app developer wants to lazily load data items until a user opens a searchbox since the data items are huge. This usage is quite resonable.
      • the au response contains commands to update items, but no item is rendered.
        {"rs":[["invoke",[{$u:'bIyP2'},"_updateItems",[{"content":"item1","id":"bIyP4"}],true,1,0,0]],["invoke",[{$u:'bIyP3'},"_updateItems",[{"content":"item1","id":"bIyP5"}],true,1,0,0]],["invoke",[{$u:'bIyP2'},"_updateItems",[{"content":"item2","id":"bIyP6"}],true,1,1,1]],["invoke",[{$u:'bIyP3'},"_updateItems",[{"content":"item2","id":"bIyP7"}],true,1,1,1]]],"rid":1}
        

      Workaround

      js patch

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: