form.setFields(items.toArray(new FormItem[]{}));
panel.add(help.asWidget());
panel.add(form.asWidget());
WindowContentBuilder builder = new WindowContentBuilder(
panel,
new DialogueOptions(
"Finish",
new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
// save
FormValidation validation = form.validate();
if(!validation.hasErrors())
{
// proceed
invokeOperaton(form.getUpdatedEntity());
}
}
},
"Cancel",
new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
// cancel
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
window.hide();
}
});
}
}
)
);
this.widget = builder.build();
}