Java Code Examples for com.smartgwt.client.widgets.form.fields.SelectItem#setDisplayField()

The following examples show how to use com.smartgwt.client.widgets.form.fields.SelectItem#setDisplayField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newCharsetSelector(String name) {
	SelectItem item = new SelectItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message("charset"));
	item.setWrapTitle(false);
	item.setDefaultValue("UTF-8");
	item.setDisplayField("name");
	item.setValueField("code");

	ListGridField code = new ListGridField("code", I18N.message("code"));
	code.setWidth(90);
	code.setHidden(true);
	code.setShowTitle(false);

	ListGridField nameField = new ListGridField("name", I18N.message("name"));
	nameField.setWidth("*");
	nameField.setShowTitle(false);

	item.setPickListFields(code, nameField);
	item.setOptionDataSource(new CharsetsDS());

	return item;
}
 
Example 2
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newStorageSelector(String name, Integer value) {
	SelectItem item = new SelectItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message("storage"));
	item.setWrapTitle(false);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWidth(100);

	ListGridField nameField = new ListGridField("name", I18N.message("name"));
	nameField.setWidth("*");
	nameField.setShowTitle(false);

	item.setPickListFields(nameField);
	item.setOptionDataSource(new StoragesDS(true, false));

	if (value != null)
		item.setValue(value.toString());

	return item;
}
 
Example 3
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Creates a select list with the barcode templates
 * 
 * @param withEmpty id an empty row must be shown
 * @param filterTemplateId the document template id to filter the ocr
 *        templates
 * @param selectedTemplateId identifier of the template to be selected by
 *        default
 * 
 * @return the item
 */
public static SelectItem newBarcodeTemplateSelector(boolean withEmpty, Long filterTemplateId,
		Long selectedTemplateId) {
	SelectItem templateItem = new SelectItem("barcodetemplate", I18N.message("barcodetemplate"));
	templateItem.setDisplayField("name");
	templateItem.setValueField("id");
	templateItem.setWidth(150);
	templateItem.setMultiple(false);
	templateItem.setWrapTitle(false);
	templateItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	templateItem.setOptionDataSource(new BarcodeTemplatesDS(withEmpty, filterTemplateId));

	if (selectedTemplateId != null)
		templateItem.setValue(selectedTemplateId.toString());
	return templateItem;
}
 
Example 4
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newEmailFromSelector(String name, String title) {
	final SelectItem selector = new SelectItem(filterItemName(name));
	if (title != null)
		selector.setTitle(I18N.message(title));
	else
		selector.setTitle(I18N.message("from"));
	selector.setWidth(300);
	selector.setWrapTitle(false);
	selector.setValueField("email");
	selector.setDisplayField("email");
	selector.setHideEmptyPickList(true);

	if (Session.get().getUser().getEmail2() != null && !Session.get().getUser().getEmail2().isEmpty())
		selector.setValueMap(Session.get().getUser().getEmail(), Session.get().getUser().getEmail2());
	else
		selector.setValueMap(Session.get().getUser().getEmail());

	selector.setValue(Session.get().getUser().getEmail());

	return selector;
}
 
Example 5
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newWorkflowSelector() {
	SelectItem item = new SelectItem("workflow", I18N.message("workflow"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	item.setWidth(250);
	item.setPickListWidth(300);
	item.setPickListFields(name, description);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWrapTitle(false);
	item.setOptionDataSource(new WorkflowsDS(false, true));
	if (!Feature.enabled(Feature.WORKFLOW))
		item.setDisabled(true);
	return item;
}
 
Example 6
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newTemplateSelector(boolean withEmpty, Long selectedTemplateId) {
	SelectItem templateItem = new SelectItem("template", I18N.message("template"));
	templateItem.setDisplayField("name");
	templateItem.setValueField("id");
	templateItem.setWidth(150);
	templateItem.setMultiple(false);
	templateItem.setWrapTitle(false);
	templateItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	templateItem.setOptionDataSource(new TemplatesDS(withEmpty, selectedTemplateId, null));

	if (!Feature.enabled(Feature.TEMPLATE))
		templateItem.setDisabled(true);
	if (selectedTemplateId != null)
		templateItem.setValue(selectedTemplateId.toString());
	return templateItem;
}
 
Example 7
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newEventSelector(String name, String title, final ChangedHandler handler, boolean folder,
		boolean workflow, boolean user) {
	final SelectItem select = newSelectItem(filterItemName(name), title);
	select.setWidth(350);
	select.setMultiple(false);
	select.setOptionDataSource(new EventsDS(folder, workflow, user));
	select.setValueField("code");
	select.setDisplayField("label");
	if (handler != null)
		select.addChangedHandler(handler);

	PickerIcon clear = new PickerIcon(PickerIcon.CLEAR, new FormItemClickHandler() {
		@Override
		public void onFormItemClick(FormItemIconClickEvent event) {
			select.clearValue();
			select.setValue((String) null);
			if (handler != null)
				handler.onChanged(null);
		}
	});
	select.setIcons(clear);
	select.setIconVAlign(VerticalAlignment.TOP);

	return select;
}
 
Example 8
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newAttributesSelector() {
	final SelectItem selectItem = new SelectItem("attributes", I18N.message("attributes"));
	selectItem.setMultiple(true);
	selectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	selectItem.setDisplayField("label");
	selectItem.setValueField("name");
	selectItem.setPickListWidth(150);
	selectItem.setOptionDataSource(new AttributesDS());
	selectItem.setWrapTitle(false);
	return selectItem;
}
 
Example 9
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newArchiveSelector(int mode, Integer status) {
	SelectItem item = new SelectItem("archive");
	item.setTitle("");
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	item.setValueField("id");
	item.setDisplayField("name");
	item.setPickListWidth(300);
	item.setPickListFields(name, description);
	item.setOptionDataSource(new ArchivesDS(mode, null, status, null));
	if (!Feature.enabled(Feature.IMPEX))
		item.setDisabled(true);
	return item;
}
 
Example 10
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates a select list with the OCR templates
 * 
 * @param withEmpty id an empty row must be shown
 * @param filterTemplateId the document template id to filter the ocr
 *        templates
 * @param selectedTemplateId identifier of the template to be selected by
 *        default
 * 
 * @return the item
 */
public static SelectItem newOCRTemplateSelector(boolean withEmpty, Long filterTemplateId, Long selectedTemplateId) {
	SelectItem templateItem = new SelectItem("ocrtemplate", I18N.message("ocrtemplate"));
	templateItem.setDisplayField("name");
	templateItem.setValueField("id");
	templateItem.setWidth(150);
	templateItem.setMultiple(false);
	templateItem.setWrapTitle(false);
	templateItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	templateItem.setOptionDataSource(new OCRTemplatesDS(withEmpty, filterTemplateId));

	if (selectedTemplateId != null)
		templateItem.setValue(selectedTemplateId.toString());
	return templateItem;
}
 
Example 11
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newDashletSelector(String name, String title) {
	SelectItem select = new SelectItem(filterItemName(name), title);
	select.setAllowEmptyValue(false);
	select.setOptionDataSource(new DashletsDS());
	select.setPickListWidth(200);
	select.setDisplayField("title");
	select.setValueField("name");

	return select;
}
 
Example 12
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newTagsMultiplePickList(String name, String title, TagsDS options, Object[] tags) {
	final SelectItem item = newSelectItem(name, title);
	item.setMultiple(true);
	item.setMultipleAppearance(MultipleAppearance.PICKLIST);
	item.setValueField("word");
	item.setDisplayField("word");
	item.setOptionDataSource(options);
	if (tags != null)
		item.setValue(tags);
	return item;
}
 
Example 13
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newAutomationRoutineSelector(String name, Long value, final ChangedHandler handler,
		boolean showEmpty) {
	final SelectItem select = newSelectItem(filterItemName(name), "routine");
	select.setValueField("id");
	select.setDisplayField("name");
	select.setEmptyDisplayValue(I18N.message("customcode"));

	ListGridField id = new ListGridField("id", I18N.message("id"));
	id.setHidden(true);
	ListGridField _name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	select.setPickListFields(id, _name, description);
	select.setPickListWidth(250);
	select.setOptionDataSource(new AutomationRoutinesDS(showEmpty));
	select.setValue(value);

	ChangedHandler setNullOnEmpty = new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			if (event != null && event.getValue().equals("")) {
				select.setValue((String) null);
				select.clearValue();
			}
		}
	};
	select.addChangedHandler(setNullOnEmpty);
	if (handler != null)
		select.addChangedHandler(handler);

	return select;
}
 
Example 14
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newFormSelector() {
	SelectItem item = new SelectItem("form", I18N.message("form"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	item.setPickListFields(name);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWrapTitle(false);
	item.setOptionDataSource(new FormsDS());
	if (!Feature.enabled(Feature.FORM))
		item.setDisabled(true);
	return item;
}
 
Example 15
Source File: NewDigObject.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createOptionsForm() {
        SelectItem selectModel = new SelectItem(DigitalObjectDataSource.FIELD_MODEL,
                i18n.NewDigObject_OptionModel_Title());
        selectModel.setRequired(true);
        selectModel.setWidth(300);
        // issue 46: always start with empty model
        selectModel.setAllowEmptyValue(true);
        selectModel.setEmptyDisplayValue(ClientUtils.format("<i>&lt;%s&gt;</i>", i18n.NewDigObject_OptionModel_EmptyValue_Title()));
        selectModel.setOptionDataSource(MetaModelDataSource.getInstance());
//        selectModel.setShowOptionsFromDataSource(true);
        selectModel.setValueField(MetaModelDataSource.FIELD_PID);
        selectModel.setDisplayField(MetaModelDataSource.FIELD_DISPLAY_NAME);
        selectModel.setAutoFetchData(true);
        selectModel.setValidators(new CustomValidator() {

            @Override
            protected boolean condition(Object value) {
                boolean valid = getFormItem().getSelectedRecord() != null;
                return valid;
            }
        });

        TextItem newPid = new TextItem(DigitalObjectDataSource.FIELD_PID);
        newPid.setTitle(i18n.NewDigObject_OptionPid_Title());
        newPid.setTooltip(i18n.NewDigObject_OptionPid_Hint());
        newPid.setLength(36 + 5);
        newPid.setWidth((36 + 5) * 8);
        newPid.setValidators(new CustomUUIDValidator(i18n));
        //newPid.setValidators(new RegExpValidator(
        //        "uuid:[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}"));
        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
        form.setAutoFocus(true);
        form.setNumCols(4);
        form.setBrowserSpellCheck(false);
        form.setFields(selectModel, newPid);
        form.setAutoWidth();
        form.setMargin(4);
        return form;
    }
 
Example 16
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newStorageTypeSelector() {
	SelectItem item = new SelectItem("type", I18N.message("type"));
	item.setWidth(140);
	item.setWrapTitle(false);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setOptionDataSource(new StoragesTypesDS());
	return item;
}
 
Example 17
Source File: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
private Widget createForm() {
    taskForm = new DynamicForm();
    taskForm.setDataSource(WorkflowTaskDataSource.getInstance());
    taskForm.setNumCols(3);
    taskForm.setColWidths("*", "*", "*");
    taskForm.setTitleOrientation(TitleOrientation.TOP);
    taskForm.setItemHoverWidth(300);

    StaticTextItem jobLabel = new StaticTextItem(WorkflowTaskDataSource.FIELD_JOB_LABEL);
    jobLabel.setColSpan("*");
    jobLabel.setWidth("*");
    jobLabel.setShowTitle(false);
    jobLabel.setReadOnlyTextBoxStyle(Editor.CSS_HEADER_INSIDE_FORM);
    jobLabel.setTextBoxStyle(Editor.CSS_HEADER_INSIDE_FORM);

    final SelectItem owner = new SelectItem(WorkflowTaskDataSource.FIELD_OWNER);
    owner.setOptionDataSource(UserDataSource.getInstance());
    owner.setValueField(UserDataSource.FIELD_ID);
    owner.setDisplayField(UserDataSource.FIELD_USERNAME);
    owner.setWidth("*");
   // owner.setValidators(new RequiredIfValidator(requiredFunc));

    TextAreaItem note = new TextAreaItem(WorkflowTaskDataSource.FIELD_NOTE);
    note.setStartRow(true);
    note.setColSpan("*");
    note.setWidth("*");

    // title tooltip is broken in SmartGWT 4.0
    final FormItemIcon taskHelpIcon = new FormItemIcon();
    taskHelpIcon.setSrc("[SKIN]/actions/help.png");
    taskHelpIcon.setTabIndex(-1);
    taskHelpIcon.setNeverDisable(true);
    taskHelpIcon.setShowIfCondition(new FormItemIfFunction() {

        @Override
        public boolean execute(FormItem item, Object value, DynamicForm form) {
            String hint = taskForm.getValueAsString(WorkflowTaskDataSource.FIELD_HINT);
            taskHelpIcon.setPrompt(hint);
            return hint != null;
        }
    });
    TextItem label = new TextItem(WorkflowTaskDataSource.FIELD_LABEL);
    label.setWidth("*");
    label.setIcons(taskHelpIcon);

    stateItem = new SelectItem(WorkflowTaskDataSource.FIELD_STATE);
    stateItem.addChangedHandler(new ChangedHandler() {

        @Override
        public void onChanged(ChangedEvent event) {
            owner.redraw();
            paramForm.markForRedraw();
        }
    });

    taskForm.setFields(jobLabel,
            label,
            owner,
            stateItem,
            new TextItem(WorkflowTaskDataSource.FIELD_CREATED),
            new TextItem(WorkflowTaskDataSource.FIELD_MODIFIED),
            new SelectItem(WorkflowTaskDataSource.FIELD_PRIORITY),
            note);
    return taskForm;
}
 
Example 18
Source File: PageForm.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
     * Create a new form.
     * @param i18n I18N
     * @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource}
     *          reference to bundle with page types.
     */
    public PageForm(ClientMessages i18n, String typeValueMapId) {
        // save on Enter is supposed mainly for ImportBatchItemEditor
        // see submit handler in ModsMultiEditor
        setSaveOnEnter(true);
        setWidth100();
        setHeight100();
        setTitleOrientation(TitleOrientation.TOP);
        SelectItem pageType = new SelectItem(ModsCustomDataSource.FIELD_PAGE_TYPE, i18n.PageForm_PageType_Title());
        pageType.setOptionDataSource(ValueMapDataSource.getInstance().getOptionDataSource(typeValueMapId));
        pageType.setValueField(BundleValue.KEY);
        pageType.setDisplayField(BundleValue.VALUE);
        pageType.setDefaultValue(ModsCustomDataSource.getDefaultPageType());
        pageType.setWidth(200);
        pageType.setEndRow(true);

        IntegerItem pageIndex = new IntegerItem(ModsCustomDataSource.FIELD_PAGE_INDEX);
        pageIndex.setTitle(i18n.PageForm_PageIndex_Title());
        pageIndex.setValidators(new IsIntegerValidator());
        pageIndex.setRequired(true);
        pageIndex.setEndRow(true);

        TextItem pageNumber = new TextItem(ModsCustomDataSource.FIELD_PAGE_NUMBER);
        pageNumber.setTitle(i18n.PageForm_PageNumber_Title());
        pageNumber.setEndRow(true);
        pageNumber.setRequired(true);
        pageNumber.setValidators(new StringTrimValidator());
//        pageNumber.setLength(5);

        final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
                i18n.PageForm_Identifiers_Title());
        identifiers.setDataSource(IdentifierDataSource.getInstance());
        identifiers.setRequired(true);
        identifiers.setValidators(
                new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
        DynamicForm identifierForm = new DynamicForm();
        identifierForm.setUseAllDataSourceFields(true);
        identifierForm.setNumCols(4);
        identifiers.setFormPrototype(identifierForm);
        identifiers.setEndRow(true);
        identifiers.setColSpan("3");

//        TextAreaItem note = new AutoFitTextAreaItem(ModsCustomDataSource.FIELD_NOTE, "Note");
        TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PageForm_Note_Title());
        note.setWidth("*");
        //https://github.com/proarc/proarc/issues/645 GWT v.6.0-p20161023 form draw issue
        note.setHeight("*");
        note.setColSpan("*");

        setFields(pageType, pageIndex, pageNumber, identifiers, note);

        IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
        integerRangeValidator.setMin(0);
        integerRangeValidator.setMax(Integer.MAX_VALUE);

        pageIndex.setValidators(integerRangeValidator);
    }
 
Example 19
Source File: WorkflowNewJobView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
private SelectItem createProfileSelector() {
    final SelectItem profile = new SelectItem(WorkflowResourceApi.NEWJOB_PROFILE, i18n.WorkflowJob_NewJobView_Field_Profile_Title());
    profile.setOptionDataSource(WorkflowProfileDataSource.getInstance());
    profile.setValueField(WorkflowProfileDataSource.FIELD_ID);
    profile.setDisplayField(WorkflowProfileDataSource.FIELD_LABEL);
    profile.setOptionCriteria(new Criteria(WorkflowProfileDataSource.FIELD_DISABLED, Boolean.FALSE.toString()));
    profile.setFilterLocally(true);
    profile.setRequired(true);
    profile.setWidth(300);
    profile.setAllowEmptyValue(true);
    ListGrid profilePickListProperties = new ListGrid();
    profilePickListProperties.setCanHover(true);
    profilePickListProperties.setShowHover(true);
    profilePickListProperties.setHoverWidth(300);
    profilePickListProperties.setHoverCustomizer(new HoverCustomizer() {

        @Override
        public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
            String hint = record.getAttribute(WorkflowProfileDataSource.FIELD_HINT);
            return hint;
        }
    });
    profile.setPickListProperties(profilePickListProperties);
    profile.addDataArrivedHandler(new DataArrivedHandler() {

        @Override
        public void onDataArrived(DataArrivedEvent event) {
            if (event.getStartRow() == 0) {
                ResultSet data = event.getData();
                int length = data.getLength();
                if (length == 1) {
                    Record r = data.get(0);
                    String profileId = r.getAttribute(WorkflowProfileDataSource.FIELD_ID);
                    profile.setValue(profileId);
                    profile.setDefaultValue(profileId);

                    fetchModelMenu(r); // fill up model menu on init
                }
            }
        }
    });
    return profile;
}
 
Example 20
Source File: WorkflowJobView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
private ListGrid createSubjobList() {
    ListGrid g = new ListGrid();
    subjobGrid = g;
    subjobsPersistance = new ListGridPersistance("WorkflowJobView.subjobList", g);

    CanvasSizePersistence sizePersistence = new CanvasSizePersistence("WorkflowJobView.subjobList", g);
    g.setHeight(sizePersistence.getHeight());

    g.setSelectionType(SelectionStyle.SINGLE);
    g.setCanGroupBy(false);
    g.setDataFetchMode(FetchMode.BASIC);
    g.setDataSource(WorkflowJobDataSource.getInstance(),
            new ListGridField(WorkflowJobDataSource.FIELD_LABEL),
            new ListGridField(WorkflowJobDataSource.FIELD_ID, 30),
            new ListGridField(WorkflowJobDataSource.FIELD_STATE, 50),
            new ListGridField(WorkflowJobDataSource.FIELD_PROFILE_ID, 80),
            new ListGridField(WorkflowJobDataSource.FIELD_OWNER, 50),
            new ListGridField(WorkflowJobDataSource.FIELD_PRIORITY, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_CREATED, 100),
            new ListGridField(WorkflowJobDataSource.FIELD_MODIFIED, 100),
            new ListGridField(WorkflowJobDataSource.FIELD_FINANCED, 100),
            new ListGridField(WorkflowJobDataSource.FIELD_MBARCODE, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MDETAIL, 100),
            new ListGridField(WorkflowJobDataSource.FIELD_MFIELD001, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MISSUE, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MSIGLA, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MSIGNATURE, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MVOLUME, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_MYEAR, 60),
            new ListGridField(WorkflowJobDataSource.FIELD_NOTE)
            );
    g.setSortField(WorkflowJobDataSource.FIELD_CREATED);
    g.setSortDirection(SortDirection.ASCENDING);

    SelectItem profileFilter = new SelectItem();
    profileFilter.setOptionDataSource(WorkflowProfileDataSource.getInstance());
    profileFilter.setValueField(WorkflowProfileDataSource.FIELD_ID);
    profileFilter.setDisplayField(WorkflowProfileDataSource.FIELD_LABEL);
    g.getField(WorkflowJobDataSource.FIELD_PROFILE_ID).setFilterEditorProperties(profileFilter);

    SelectItem owner = new SelectItem();
    owner.setOptionDataSource(UserDataSource.getInstance());
    owner.setValueField(UserDataSource.FIELD_ID);
    owner.setDisplayField(UserDataSource.FIELD_USERNAME);
    g.getField(WorkflowJobDataSource.FIELD_OWNER).setFilterEditorProperties(owner);

    g.addSelectionUpdatedHandler((SelectionUpdatedEvent event) -> {
        if (!ignoreSubjobSelection) {
            editSubjobSelection();
        }
        ignoreSubjobSelection = false;
    });
    return g;
}