}
selectorItem.setCanvas(resourceGroupSelector);
form.setFields(selectorItem, metric, new SpacerItem());
form.addSubmitValuesHandler(new SubmitValuesHandler() {
public void onSubmitValues(SubmitValuesEvent submitValuesEvent) {
ResourceGroup selectedGroup = resourceGroupSelector.getSelectedGroup();
String groupId = selectedGroup == null ? null : String.valueOf(selectedGroup.getId()); // can be null
storedPortlet.getConfiguration().put(new PropertySimple(CFG_RESOURCE_GROUP_ID, groupId));
storedPortlet.getConfiguration().put(