Announcement

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

    possible Bug: the parameter "record" in CellEditValueParser is null

    Hello,

    I currrently evaluating the 3.1d enterprise edition (20121004) and sometimes get a null record in the callback handler
    Code:
    com.smartgwt.client.widgets.grid.CellEditValueParser::parse
    Is this a valid behaviour or a bug?

    This code reporduces the problem:
    Code:
    		ListGridField f1 = new ListGridField("f1");
    		ListGridField f2 = new ListGridField("f2");
    		f2.setEditValueParser(new CellEditValueParser() {
    			@Override
    			public Object parse(Object value, ListGridRecord record, int rowNum, int colNum) {
    				if (record == null) {
    					SC.warn("Record is null");
    				}
    				return value;
    			}
    		});
    		lg.setFields(f1, f2);
    		lg.setCanEdit(true);
    		ListGridRecord record = new ListGridRecord();
    		record.setAttribute("f1", "test");
    		lg.startEditingNew(record);
    		lg.draw();
    If you type something in field "f2" and leave focus you get the error.

    Btw.: my aim is it, to read some values from the currently edited record, no matter if it is an existing ar a new one.

    #2
    Take a look at the ListGrid Editing overview - for a new, not yet saved row, there is no Record as such, only editValues.

    Comment

    Working...
    X