return new HTMLFlow(MSG.view_portlet_help_config_updates());
}
@Override
public DynamicForm getCustomSettingsForm() {
final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
final Configuration portletConfig = storedPortlet.getConfiguration();
DynamicForm customSettings = new DynamicForm();
EnhancedVLayout page = new EnhancedVLayout();
//build editor form container
final DynamicForm form = new DynamicForm();
form.setMargin(5);
//add sort priority selector
// final SelectItem resultSortSelector = PortletConfigurationEditorComponent
// .getResulSortOrderEditor(portletConfig);
//add result status selector
final SelectItem resultStatusSelector = PortletConfigurationEditorComponent
.getConfigurationUpdateStatusEditor(portletConfig);
//add result count selector
final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
//add range selector
final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
.getMeasurementRangeEditor(portletConfig);
// form.setItems(alertPrioritySelector, resultCountSelector);
form.setItems(resultStatusSelector, resultCountSelector);
//submit handler
customSettings.addSubmitValuesHandler(new SubmitValuesHandler() {
@Override
public void onSubmitValues(SubmitValuesEvent event) {
// //result sort order
// selectedValue = resultSortSelector.getValue().toString();
// if ((selectedValue.trim().isEmpty()) || (selectedValue.equalsIgnoreCase(PageOrdering.DESC.name()))) {//then desc
// portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.DESC));
// } else {
// portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.ASC));
// }
//config status
Configuration updatedConfig = AbstractActivityView.saveConfigUpdateStatusSelectorSettings(
resultStatusSelector, portletConfig);
//result count
updatedConfig = AbstractActivityView.saveResultCounterSettings(resultCountSelector, updatedConfig);
//time range settings
updatedConfig = AbstractActivityView.saveMeasurementRangeEditorSettings(measurementRangeEditor,
updatedConfig);
//persist and reload portlet
storedPortlet.setConfiguration(updatedConfig);
configure(portletWindow, storedPortlet);
refresh();
}
});
form.markForRedraw();