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

Cell and editing: edit not terminated on transfering focus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • fx2.0
    • fx2.0
    • javafx
    • fx-beta-b36

      use-case: editing a cell and clicking somewhere outside must commit the edit.

      Implementation intention seems to be to cancel the edit (which would be wrong, because highly unexpected by users), see discussion in RT-15336 and focusListener installed in Cell constructor.Actually, nothing happens (editor still active, showing the modified data, though).

      To reproduce, take sample code of RT-15205 and add the following (to simulate a typical edit/save situation). Then
      - start edit some row and change its content
      - click on the save button
      expected: editor removed and edited content committed
      is: editor visible, edited content not committed

                  Button save = new Button("save");
                  save.setOnAction(new EventHandler<ActionEvent>() {

                      @Override
                      public void handle(ActionEvent event) {
                          // actual code would be something like save(list.getItems());
                          // simulate
                          int selected = list.getSelectionModel().getSelectedIndex();
                          if (selected >= 0) {
                              System.out.println("data? " + selected + list.getItems().get(selected));
                          }
                      }
                      
                  });
                  box.getChildren().add(save);

       


            jgiles Jonathan Giles
            fastegal Jeanette Winzenburg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: