public void onRecordExpand(RecordExpandEvent event) {
event.getRecord().setAttribute("Expanded", true);
}
});
addRecordCollapseHandler(new RecordCollapseHandler() {
@Override
public void onRecordCollapse(RecordCollapseEvent event) {
event.getRecord().setAttribute("Expanded", false);
}