title: Working with DateTime as StringProperty
body: <p>I have defined a DateTime field as StringProperty in my model to display date. I have few rows where the date column is empty in database and have defined a cellfactory to display the date in a desired format &amp; blank for empty rows. My problem starts when i try to update one of those empty columns. The new date doesnt appear. It works for the rows where there is already a date value present.</p>
  
  <p>Part of cellfactory:</p>
  
  <pre><code>txtfld.setOnKeyPressed(new EventHandler&lt;KeyEvent&gt;() {
          @Override
          public void handle(KeyEvent t) {
              if (t.getCode() == KeyCode.ENTER) {
                  if(txtfld.getText().length() == 0) {
                      commitEdit(null);
                  } else {
                      commitEdit((new DateTime(txtfld.getText(),"dd/MM/yyyy")).toString());
                  }
              } else if (t.getCode() == KeyCode.ESCAPE) {
                  cancelEdit();
              }
          }
      });
  </code></pre>
  
  <p>And the part where I am updating the model:</p>
  
  <pre><code>col_Purchase_DT.setOnEditCommit(new EventHandler&lt;CellEditEvent&lt;Purchase, String&gt;&gt;() {
          @Override 
          public void handle(CellEditEvent&lt;Purchase, String&gt; tbl) {
               (tbl.getTableView().getItems().get(tbl.getTablePosition().getRow())).setDOB(tbl.getNewValue());
         }
     });
  </code></pre>
  
  <p>I have figured it out that after updating the empty cell with a date col_Purchase_DT.setOnEditCommit() is not called. But is works for non-empty cell. I am using JodaTime for datetime.</p>
  
  <p><img src="https://i.stack.imgur.com/77TAE.png" alt="enter image description here"></p>
  
  <p>I cannot update the second row. But it works perfectly for first &amp; third row.</p>
  
  <p>Any pointers will be helpful.</p>