ComboBox comboBox = new ComboBox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable()); comboBox.setNullSelectionAllowed(false);
ComboBox accountStatusChoice = new ComboBox(); accountStatusChoice.setCaption(MessageResource.getLocalizedString("caption.accountStatus")); accountStatusChoice.setRequired(true); accountStatusChoice.setRequiredError(MessageResource.getLocalizedString("error.required.accountStatus")); accountStatusChoice.setImmediate(true); for (AccountStatus accountStatus : AccountStatus.values()) { accountStatusChoice.addItem(accountStatus); accountStatusChoice.setItemCaption(accountStatus, MessageResource.getLocalizedString(accountStatus.name())); } return accountStatusChoice;
public Field getPropertyField(FormProperty formProperty) { ComboBox comboBox = new MonthCombobox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable()); // Fill combobox I18nManager i18nManager = ExplorerApp.get().getI18nManager(); for (int i=0; i<12; i++) { comboBox.addItem(i); comboBox.setItemCaption(i, i18nManager.getMessage(Messages.MONTH_PREFIX + i)); } // Select first comboBox.setNullSelectionAllowed(false); Calendar cal = Calendar.getInstance(); comboBox.select(cal.get(Calendar.MONTH)); return comboBox; }
public Field getPropertyField(FormProperty formProperty) { ComboBox comboBox = new ComboBox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable()); List<ProcessDefinition> processDefinitions = ProcessEngines.getDefaultProcessEngine() .getRepositoryService() .createProcessDefinitionQuery() .orderByProcessDefinitionName().asc() .orderByProcessDefinitionVersion().asc() .list(); for (ProcessDefinition processDefinition : processDefinitions) { comboBox.addItem(processDefinition.getId()); String name = processDefinition.getName() + " (v" + processDefinition.getVersion() + ")"; comboBox.setItemCaption(processDefinition.getId(), name); } // Select first if (!processDefinitions.isEmpty()) { comboBox.setNullSelectionAllowed(false); comboBox.select(processDefinitions.get(0).getId()); } return comboBox; }
actionCombo.setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("action")); actionCombo.setRequired(false); actionCombo.setRequiredError("An action must be selected!"); actionCombo.setValidationVisible(false); actionCombo.setNullSelectionAllowed(true);
this.targetServerComboBox.setRequiredError("A target server is required!"); targetServerComboBox.setValidationVisible(false); formLayout.addComponent(this.targetServerComboBox, 1, 2);
this.contextCombo.setNullSelectionAllowed(false); this.contextCombo.setRequired(true); this.contextCombo.setRequiredError("Please select a context"); this.contextCombo.setValue(notification.getContext()); this.filterCombo.setRequiredError("Please select a filter");
relationshipCombo.setValidationVisible(false); relationshipCombo.setRequired(true); relationshipCombo.setRequiredError("A relationship must be selected!"); relationshipCombo.setHeight("30px"); relationshipCombo.setNullSelectionAllowed(false); jobTopCombo.setValidationVisible(false); jobTopCombo.setRequired(true); jobTopCombo.setRequiredError("A job type must be selected!"); jobTopCombo.setHeight("30px"); jobTopCombo.setNullSelectionAllowed(false); timeToLiveTextField.setRequired(true); timeToLiveTextField.setValidationVisible(false); jobTopCombo.setRequiredError("A time to live value must be entered!"); timeToLiveTextField.setVisible(false); timeToLiveTextField.setWidth("40%");