EnhancedHLayout sheduledOperationsLayout = new EnhancedHLayout();
final CheckboxItem enableScheduledOperationsGrouping = new CheckboxItem();
enableScheduledOperationsGrouping.setName(OPERATIONS_RANGE_SCHEDULED_ENABLED);
enableScheduledOperationsGrouping.setTitle(" " + MSG.view_portlet_operations_config_show_next() + " ");
enableScheduledOperationsGrouping.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
String selectedItem = "" + event.getValue();
//stuff into the master form for retrieval
form.setValue(OPERATIONS_RANGE_SCHEDULED_ENABLED, selectedItem);
}
});
//wrap field item in dynamicform for addition
DynamicForm fieldWrapper = new DynamicForm();
fieldWrapper.setFields(enableScheduledOperationsGrouping);
sheduledOperationsLayout.addMember(fieldWrapper);
//retrieve previous value otherwise initialize to true(live unlimited list)
PropertySimple property = storedPortlet.getConfiguration().getSimple(OPERATIONS_RANGE_SCHEDULED_ENABLED);
if (property != null) {
enableScheduledOperationsGrouping.setValue(property.getBooleanValue());
} else {
enableScheduledOperationsGrouping.setValue(true);
}
//------------- Build second combobox for timeframe for problem resources search.
final SelectItem maximumScheduledOperationsComboBox = new SelectItem(OPERATIONS_RANGE_SCHEDULED);
maximumScheduledOperationsComboBox.setTitle("");
maximumScheduledOperationsComboBox.setHint("<nobr><b> " + MSG.common_label_scheduled_operations()
+ ".</b></nobr>");
maximumScheduledOperationsComboBox.setType("selection");
//define acceptable values for display amount
String[] acceptableDisplayValues = { "1", "5", "10", "15", unlimitedString };
maximumScheduledOperationsComboBox.setValueMap(acceptableDisplayValues);
maximumScheduledOperationsComboBox.setWidth(100);
maximumScheduledOperationsComboBox.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
String selectedItem = "" + event.getValue();
//stuff into the master form for retrieval
form.setValue(OPERATIONS_RANGE_SCHEDULED, selectedItem);
}