detailForm.fromForm(entry.getKey(), entry.getValue());
masterGrid.updateValue(selectedValue);
}
masterGrid.saveOrUpdateValue(selectedValue);
masterGrid.selectValue(selectedValue);
item.fireEvent(new ChangedEvent(item.getJsObj()));
updateButtonState(false);
}
}
});
newButton = new IButton(I18nProvider.getAttribute().btnNewTitle());
newButton.setTooltip(I18nProvider.getAttribute().btnNewTooltip());
newButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
selectedValue = createInstance();
detailForm.clear();
for (AttributeInfo info : featureInfo.getAttributes()) {
detailForm.toForm(info.getName(), selectedValue.getAllAttributes().get(info.getName()));
}
updateButtonState(false);
}
});
deleteButton = new IButton(I18nProvider.getAttribute().btnDeleteTitle());
deleteButton.setTooltip(I18nProvider.getAttribute().btnDeleteTooltip());
deleteButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (selectedValue != null) {
if (masterGrid.deleteValue(selectedValue)) {
detailForm.clear();
selectedValue = null;
item.fireEvent(new ChangedEvent(item.getJsObj()));
updateButtonState(false);
}
}
}
});