title: ControlsFx - Spreadsheetview - DateCell - keep editing on failure
body: <p>we use a spreadsheetview with different kind of cell types.</p>
  
  <p>In the documentation to <strong><a href="https://controlsfx.bitbucket.io/org/controlsfx/control/spreadsheet/SpreadsheetCellEditor.html" rel="nofollow noreferrer">SpreadsheetCellEditor</a></strong> we found the following text:</p>
  
  <blockquote>
    <p>The policy regarding validation of a given value is defined in 
    SpreadsheetCellType.match(Object). If the value doesn't meet the requirements 
    when saving the cell, nothing happens and the editor keeps editing.</p>
  </blockquote>
  
  <hr>
  
  <p>now we facing the following problem:</p>
  
  <p>if you enter "abcd" in an integer cell as a wrong entry and push enter key, nothing happens. Editor is still in edit mode. This is exactly the behaviour as descripted in the documentation. that is what we want.</p>
  
  <p>if you have a date cell and enter a wrong date or something else and push enter key, cell stops editing mode and set value return to "old" value.</p>
  
  <p>how can we prevent this behaviour?
  Maybe its a bug in the Date SpreadsheetCellType?</p>
  
  <p>we use a lot of custom cellType Classes, but the behaviour is also comprehensibly with this little example.</p>
  
  <p>I hope everything is well explained.</p>
  
  <p>Thanks for your help.</p>
  
  <pre><code>import java.time.LocalDate;
  import javafx.application.Application;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.scene.Scene;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  import org.controlsfx.control.spreadsheet.GridBase;
  import org.controlsfx.control.spreadsheet.SpreadsheetCell;
  import org.controlsfx.control.spreadsheet.SpreadsheetCellType;
  import org.controlsfx.control.spreadsheet.SpreadsheetView;
  
  public class SpreadSheetExample extends Application {
  
  private SpreadsheetView getSpreadSheet() {
      SpreadsheetView spreadSheetView;
      GridBase grid;
      grid = new GridBase(10, 2);
      spreadSheetView = new SpreadsheetView(grid);
  
      ObservableList&lt;ObservableList&lt;SpreadsheetCell&gt;&gt; rows = FXCollections.observableArrayList();
      for (int row = 0; row &lt; grid.getRowCount(); ++row) {
          final ObservableList&lt;SpreadsheetCell&gt; list = FXCollections.observableArrayList();
          for (int column = 0; column &lt; grid.getColumnCount(); ++column) {
              if (column &lt; 1) {
                  list.add(SpreadsheetCellType.DATE.createCell(row, column, 1, 1, LocalDate.now()));
              } else {
                  list.add(SpreadsheetCellType.INTEGER.createCell(row, column, 1, 1, column));
              }
  
          }
          rows.add(list);
      }
  
      spreadSheetView.getColumns().forEach((column) -&gt; {
          column.setPrefWidth(280);
      });
  
      grid.setRows(rows);
  
      return spreadSheetView;
  }
  
  @Override
  public void start(Stage primaryStage) {
  
      StackPane root = new StackPane();
      root.getChildren().add(getSpreadSheet());
  
      Scene scene = new Scene(root, 800, 400);
  
      primaryStage.setTitle("Hello World!");
      primaryStage.setScene(scene);
      primaryStage.show();
  }
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      launch(args);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Update:
  are there no controlsfx experts?</strong></p>
  
  <p><strong>Solved:</strong>
  <a href="https://groups.google.com/forum/#!topic/controlsfx-dev/ro7-MvLFD1A" rel="nofollow noreferrer">https://groups.google.com/forum/#!topic/controlsfx-dev/ro7-MvLFD1A</a></p>