Tuesday, January 3, 2012

smartgwt ListGridRecord programatically editing issue

I am using smartgwt and i have a ListGrid in which i have some
populated values in ListGridRecord. now if i am setting any
listGridRecord Field value programmatically through
setAttribute(String fieldName, String value) and refreshing the field
through ListGridRecord.refreshFields(), then values get reflected to
the UI. but the problem is if i am editing that same ListGridRecord by
double click. then the value get lost or removed from the UI.

class FieldRecord extends ListGridRecord{

private int id;
private String name;

public void setID(Long id) {
setAttribute(Constant.ID, id);
}

public void setName(String name) {
setAttribute(Constant.NAME, name);
}

public Long getID() {
return getAttribute(Constant.ID);
}

public String getName() {
return getAttribute(Constant.NAME);
}
}


class testData {
FieldDataSource fieldDS = new FieldDataSource();

FieldRecord fieldRec = new FieldRecord();
//set some default value of record.

fieldDS.addData(fieldRec);
FieldGrid fieldGrid = new FieldGrid();
fieldGrid.setDataSource(fieldDS);

public void parseValue(){
// on some condition
fieldRec.setAttribute(Constant.NAME, "high");
// programmaticaly set record value and that value is removed when i
double click on
that record.
}
}


any help from you will be highly appreciated.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment