form,
new FormToolStrip.FormCallback<ModelNode>() {
@Override
public void onSave(Map<String, Object> changeset) {
InteractionEvent saveEvent = new InteractionEvent(SAVE_ID);
saveEvent.setPayload(form.getChangedValues());
coordinator.fireEventFromSource(
saveEvent,
interactionUnit.getId()
);
}
@Override
public void onDelete(ModelNode entity) {
// unsupported
}
});
StaticHelpPanel help = new StaticHelpPanel(helpTexts.toSafeHtml());
layout.add(tools.asWidget());
layout.add(help.asWidget());
layout.add(form.asWidget());
// handle resets within this scope
coordinator.addHandler(SystemEvent.TYPE, new SystemEvent.Handler() {
@Override
public boolean accepts(SystemEvent event) {
return event.getId().equals(RESET_ID) ;
}
@Override
public void onSystemEvent(SystemEvent event) {
form.clearValues();
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
// request loading of data
InteractionEvent loadEvent = new InteractionEvent(LOAD_ID);
// update interaction units
coordinator.fireEventFromSource(
loadEvent,
interactionUnit.getId()