Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridFieldType.TIME cannot be blank

    Using the pro nightly from 6/6.

    Once you start editing a ListGridFieldType.TIME you cannot make it blank. Seems like an overzealous time parser. Instead of null it parses "" into 12:00.

    Code:
    		ListGrid listGrid = new ListGrid();
    		ListGridField listGridField = new ListGridField("time");
    		listGridField.setType(ListGridFieldType.TIME);
    		listGrid.setFields(listGridField);
    		listGrid.startEditingNew();
    		listGrid.draw();

    #2
    This fixes it.

    Code:
    		TimeItem timeItem = new TimeItem("time");
    		timeItem.setEditorValueParser(new FormItemValueParser() {
    			@Override
    			public Object parseValue(String value, DynamicForm form,
    					FormItem item) {
    				if (value == null || value.length() == 0)
    					return null;
    				else
    					return value;
    			}
    		});
    		ListGrid listGrid = new ListGrid();
    		ListGridField listGridField = new ListGridField("time");
    		listGridField.setType(ListGridFieldType.TIME);
    		listGrid.setFields(listGridField);
    		listGridField.setEditorType(timeItem);
    		listGrid.startEditingNew();
    		listGrid.draw();

    Comment


      #3
      Thanks for the report - this is fixed internally and will appear in the next nightly

      Comment

      Working...
      X