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

ListModelList.add(0, value) leads to full re-render of grid rows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 10.0.0
    • General
    • A grid with a row renderer and a ListModelList as model. The row rendered creates a textbox, no binding. 

      Steps to Reproduce

      Enter something into the textbox and call model.add(0, value) to add a row to the top.

      Current Result

      All rows a re-rendered, text in Textbox is lost.

      Expected Result

      Prior to ZK 10, adding a line by adding an entry in 1st position just had that entry be rendered and added to the front. Text in Textbox would remain unaffected.

      Debug Information

       

      Workaround

      Ugly stuff like

      if (meshElement instanceof Grid) {
                  Grid grid = (Grid) meshElement;
                  RowRenderer<Object> rowRenderer = grid.getRowRenderer();
                  if (rowRenderer != null)

      {                 Rows rows = grid.getRows();                 Row row = new Row();                 rows.insertBefore(row, rows.getFirstChild());                 rowRenderer.render(row, newEntry, 0);             }

              } else if (meshElement instanceof Listbox) {
                  Listbox listbox = (Listbox) meshElement;
                  ListitemRenderer<Object> itemRenderer = listbox.getItemRenderer();
                  if (itemRenderer != null)

      {                 Listitem listitem = new Listitem();                 listbox.insertBefore(listitem, listbox.getFirstChild());                 itemRenderer.render(listitem, newEntry, 0);             }

              }

            Unassigned Unassigned
            chemFelix chemFelix
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: