Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8107942

javfx.scene.control.ListView fails when underlying model is changed

XMLWordPrintable

      I am using a ListView to display a list of strings. When I change the sequence that the list.items is bound to I get a long stacktrace and the scene fails to render. Here is the code:

      var list:ListView;
      var moveCount:Integer = 0;
      var moves:String[] = ["1: a3 Nc6", "2: e3"];
      ...
      if(isWhiteTurn){
        moveCount++;
        insert "\n{moveCount}: {moveString}" into moves;
      }else{
        moves[moveCount-1] = "{moves[moveCount-1]} {moveString}";
      }
      ...
      list = ListView{items: bind moves}

      Attached is the stacktrace generated.

      BTW: the ListView is placed in another component which has a variable clipping rectangle.

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: