Class SavedSearchItem
- All Implemented Interfaces:
HasHandlers,HasBlurHandlers,HasChangedHandlers,HasChangeHandlers,HasClickHandlers,HasDataArrivedHandlers,HasDoubleClickHandlers,HasEditorEnterHandlers,HasEditorExitHandlers,HasFocusHandlers,HasIconClickHandlers,HasIconKeyPressHandlers,HasItemHoverHandlers,HasKeyDownHandlers,HasKeyPressHandlers,HasKeyUpHandlers,HasPendingStatusChangedHandlers,HasPickerIconClickHandlers,HasShowContextMenuHandlers,HasTitleClickHandlers,HasTitleDoubleClickHandlers,HasTitleHoverHandlers,HasValueHoverHandlers,HasValueIconClickHandlers,PickList
target using the SavedSearches system. Normally, a SavedSearchItem is just provided a targetComponent, and all other configuration
comes from the central SavedSearches class by default. The
targetComponent must be a DataBoundComponent with a DataSource configured.
Searches are applied to the
target by calling DataBoundComponent.fetchData(), or,
for ListGrids, by calling ListGrid.setViewState(). If
saveLastSearch is set, the name of the
last search is automatically stored in browser localStorage, and will be applied to the
targetComponent as soon as saved searches are loaded.
By default, SavedSearchItem acquires
the default DataSource for storing searches and uses
it as SelectItem.optionDataSource. The
displayed value is the user's name for the search (from SavedSearches.searchNameField) followed by a user-readable summary of the stored search, derived from DataSource.getAdvancedCriteriaDescription(), with a
hover to show long values that may be clipped.
If adding searches is allowed, the
SavedSearchItem either shows a FormItemIcon (addSearchIcon) or a pickList entry for adding
searches (addSearchValue). Either
interface opens an EditSearchWindow.
The PickList is automatically configured to
show the search name plus the search description (via pickListFields), plus additional columns for
icons for editing, removal, copying existing searches, and choosing a default search.
Admin-configured searches are displayed after user-created searches, after a separator.
searchChanged() fires when the user selects a new
saved search, saves changes to an existing saved search, or saves a new search. Note that valueField is set to SavedSearches.componentIdField and displayField to SavedSearches.searchNameField.
Saving new searches also
causes targetDataSource to be
required. You can set newRecordValues to a set of fixed values that should be saved whenever the user saves a new search; this can be used to
save searches related to the current user's userId, for example.
The special interface that allows an admin to save
shared searches appears if the user has the adminRole as determined by Authentication.hasRole().
Saving full "viewState" for grids
If the targetComponent is a ListGrid or TreeGrid, the default behavior
is to store the complete ListGrid.viewState rather that
just search criteria. If you want to store just criteria, set storedState to "criteria".
Note: this feature requires Smart GWT Pro or better.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.smartgwt.client.widgets.form.fields.FormItem
FormItem.CustomStateGetter, FormItem.StateCustomizer -
Field Summary
Fields inherited from class com.smartgwt.client.widgets.form.fields.FormItem
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefaultFields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
ConstructorsConstructorDescriptionSavedSearchItem(JavaScriptObject jsObj) SavedSearchItem(String name) SavedSearchItem(String name, String title) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeAutoChildDefaults(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName.static voidchangeAutoChildDefaults(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName.static voidchangePickerIconDefaults(FormItemIcon defaults) Icon to be used to show theEditSearchWindow.Setting this property moves thecanAddSearchfunctionality from an icon next to the form item (addSearchIcon) to the dropdown.Role to check for (viaAuthentication.hasRole()to determine whether admin interfaces are shown.Properties for the separator record between locally saved and admin searches.booleanThis flag controls whether adding new searches is allowed.Whether existing searches can be copied.Whether existing searches can be edited.Optional name of a boolean field in the records returned by theoptionDataSource, where setting the field tofalsemeans the Record cannot be edited or removed by the current user.booleanWhether existing searches can be removed.booleanWhether a confirmation message should be shown when a user removes a saved search.Message shown whenremoval confirmationis enabled and user attempts to remove a saved search.ListGridField shown in the pickList to allow users to copy existing searches.Hover text that appeares over the +{copySearchField}HTML string to append to the search title in the search name field if this is the default search.Default class used to construct theEditProxyfor this component when the component isfirst placed into edit mode.ListGridField shown in the pickList to allow users to edit existing searches.Hover text that appeares over the +{editSearchField}Modal pop-up window shown when the user adds or edits a search, instance of ofEditSearchWindow.getHint()Text shown inside the field that serves as an indicator of what this field is for.ListGridField shown in the pickList to allow admin users to designate which field is the admin-default search.Hover text that appeares over the +{markAsAdminDefaultField}ListGridField shown in the pickList to allow users to designate which field is the default search.Hover text that appeares over the +{markAsDefaultField}Additional, fixed Record values that should be used every time a new search is saved.Optional key used for local storage of saved searches by this component.static SavedSearchItemgetOrCreateRef(JavaScriptObject jsObj) The SavedSearchItem pickListFields are automatically generated and contain fields for the search name plus the search description, plus additional columns for icons for editing, removal, copying existing searches, and choosing a default search.ListGridField shown in the pickList to allow users to remove existing searches.Hover text that appeares over the +{removeSearchField}booleanWorks identically toListGrid.saveDefaultSearch.Optional override ofSavedSearches.defaultDataSourcefor this SavedSearchItem.Optional explicit identifier for saved searches.booleanIf set, the name of the last search is automatically stored in browserlocalStorage, and will be applied to thetargetComponentas soon as saved searches are loaded.Set to "criteria" if you want only criteria to be stored for ListGrids and TreeGrids instead of the full viewState of the component.Component that saved searches should apply to.DataSource that the saved searches are performed against.Whether thetargetComponenthas built-in criteria editing or does not.getTitle()Title of this FormItem.booleansearchChanged(Criteria newCriteria, Record searchData) Event fired whenever a user changes the currently selected saved search, modifies a saved search or adds a new saved search.setAddSearchIcon(String addSearchIcon) Icon to be used to show theEditSearchWindow.setAddSearchValue(String addSearchValue) Setting this property moves thecanAddSearchfunctionality from an icon next to the form item (addSearchIcon) to the dropdown.setAdminRole(String adminRole) Role to check for (viaAuthentication.hasRole()to determine whether admin interfaces are shown.setCanAddSearch(boolean canAddSearch) This flag controls whether adding new searches is allowed.setCanCopySearch(Boolean canCopySearch) Whether existing searches can be copied.setCanEditSearch(Boolean canEditSearch) Whether existing searches can be edited.setCanModifyProperty(String canModifyProperty) Optional name of a boolean field in the records returned by theoptionDataSource, where setting the field tofalsemeans the Record cannot be edited or removed by the current user.setCanRemoveSearch(boolean canRemoveSearch) Whether existing searches can be removed.setConfirmRemoval(boolean confirmRemoval) Whether a confirmation message should be shown when a user removes a saved search.setConfirmRemovalMessage(String confirmRemovalMessage) Message shown whenremoval confirmationis enabled and user attempts to remove a saved search.setCopySearchHoverText(String copySearchHoverText) Hover text that appeares over the +{copySearchField}static voidsetDefaultProperties(SavedSearchItem savedSearchItemProperties) Class level method to set the default properties of this class.setDefaultSearchNameSuffix(String defaultSearchNameSuffix) HTML string to append to the search title in the search name field if this is the default search.setEditProxyConstructor(String editProxyConstructor) Default class used to construct theEditProxyfor this component when the component isfirst placed into edit mode.setEditSearchHoverText(String editSearchHoverText) Hover text that appeares over the +{editSearchField}Text shown inside the field that serves as an indicator of what this field is for.setMarkAsAdminDefaultHoverText(String markAsAdminDefaultHoverText) Hover text that appeares over the +{markAsAdminDefaultField}setMarkAsDefaultHoverText(String markAsDefaultHoverText) Hover text that appeares over the +{markAsDefaultField}setNewRecordValues(Record newRecordValues) Additional, fixed Record values that should be used every time a new search is saved.setOfflineStorageKey(String offlineStorageKey) Optional key used for local storage of saved searches by this component.setRemoveSearchHoverText(String removeSearchHoverText) Hover text that appeares over the +{removeSearchField}setSaveDefaultSearch(boolean saveDefaultSearch) Works identically toListGrid.saveDefaultSearch.setSavedSearchDS(String savedSearchDS) Optional override ofSavedSearches.defaultDataSourcefor this SavedSearchItem.setSavedSearchId(String savedSearchId) Optional explicit identifier for saved searches.setSaveLastSearch(boolean saveLastSearch) If set, the name of the last search is automatically stored in browserlocalStorage, and will be applied to thetargetComponentas soon as saved searches are loaded.setStoredState(SavedSearchStoredState storedState) Set to "criteria" if you want only criteria to be stored for ListGrids and TreeGrids instead of the full viewState of the component.setTargetComponent(DataBoundComponent targetComponent) Component that saved searches should apply to.setTargetDataSource(DataSource targetDataSource) DataSource that the saved searches are performed against.setTargetEditsCriteria(Boolean targetEditsCriteria) Whether thetargetComponenthas built-in criteria editing or does not.Title of this FormItem.Methods inherited from class com.smartgwt.client.widgets.form.fields.SelectItem
addDataArrivedHandler, defaultDynamicValue, fetchData, fetchData, fetchData, filterClientPickListData, getAddUnknownValues, getAllowEmptyValue, getAllowMultiCharSearch, getAnimatePickList, getAnimationTime, getAutoFetchData, getAutoOpenTree, getCachePickListResults, getCanSelectText, getClickMaskMode, getClientPickListData, getControlStyle, getDataSetType, getDefaultToFirstOption, getDefaultValue, getDisplayField, getDisplayFieldName, getEmptyDisplayValue, getEmptyPickListHeight, getEmptyPickListMessage, getEscapeHTML, getFetchDelay, getFetchDisplayedFieldsOnly, getFilterLocally, getHideEmptyPickList, getIconPlacement, getInitialSort, getMultiple, getMultipleAppearance, getOpenOnDownArrow, getOpenOnSpace, getOptionDataSource, getOptionOperationId, getPickerClearButton, getPickerClearButtonTitle, getPickerExitButton, getPickerExitButtonTitle, getPickerIconHeight, getPickerIconSrc, getPickerIconStyle, getPickerIconWidth, getPickerNavigationBar, getPickList, getPickListBaseStyle, getPickListCellHeight, getPickListConstructor, getPickListCriteria, getPickListFilterCriteria, getPickListHeaderHeight, getPickListHeight, getPickListMaxWidth, getPickListPlacement, getPickListPlacementAsCanvas, getPickListPlacementAsString, getPickListWidth, getPickTreeConstructor, getProgressiveLoading, getRootNodeId, getRootNodeIdAsInt, getSaveOnEnter, getSelectedRecord, getSelectedRecords, getSeparateSpecialValues, getSeparateValuesList, getShowAllOptions, getShowFocused, getShowHintInField, getShowOptionsFromDataSource, getShowOver, getShowPickerIcon, getSingleClickFolderToggle, getSortField, getSortFieldAsInt, getSortFieldAsStringArray, getSpecialValues, getTextBoxStyle, getTextMatchStyle, getUpdateControlOnOver, getUpdateTextBoxOnOver, getUseClientFiltering, getValueAsString, getValueField, getValueFieldName, getValueIconField, getValues, isMultiple, pendingStatusChanged, setAddUnknownValues, setAllowEmptyValue, setAllowMultiCharSearch, setAnimatePickList, setAnimationTime, setAutoFetchData, setAutoOpenTree, setCachePickListResults, setCanSelectText, setClickMaskMode, setControlStyle, setDataSetType, setDefaultProperties, setDefaultToFirstOption, setDefaultValues, setDefaultValues, setDisplayField, setEmptyDisplayValue, setEmptyPickListHeight, setEmptyPickListMessage, setEscapeHTML, setFetchDelay, setFetchDisplayedFieldsOnly, setFilterLocally, setHideEmptyPickList, setIconPlacement, setInitialSort, setMultiple, setMultipleAppearance, setOpenOnDownArrow, setOpenOnSpace, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerClearButtonTitle, setPickerExitButtonTitle, setPickerIconHeight, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPickListBaseStyle, setPickListCellHeight, setPickListConstructor, setPickListCriteria, setPickListCriteria, setPickListFields, setPickListFilterCriteriaFunction, setPickListFilterCriteriaFunction, setPickListHeaderHeight, setPickListHeight, setPickListMaxWidth, setPickListPlacement, setPickListPlacement, setPickListPlacement, setPickListProperties, setPickListSort, setPickListWidth, setPickTreeConstructor, setProgressiveLoading, setRootNodeId, setRootNodeId, setSaveOnEnter, setSeparateSpecialValues, setSeparatorRows, setShowAllOptions, setShowFocused, setShowHintInField, setShowOptionsFromDataSource, setShowOver, setShowPickerIcon, setSingleClickFolderToggle, setSortField, setSortField, setSortField, setSpecialValues, setSpecialValues, setSpecialValues, setTextBoxStyle, setTextMatchStyle, setUpdateControlOnOver, setUpdateTextBoxOnOver, setUseClientFiltering, setValueField, setValueIconField, setValues, showPickerMethods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIcon, addIcon, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, checkFormItemType, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusAfterItem, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAlwaysShowControlBox, getApplyAlignToText, getApplyHeightToTextBox, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getAutoCompleteKeywords, getBrowserInputType, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanHover, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getChangeOnKeypress, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDefaultOperator, getDestroyed, getDisabled, getDisabledHover, getDisableIconsOnReadOnly, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconProperties, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getExportFormat, getFetchMissingValues, getFieldName, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHeight, getHeightAsString, getHidden, getHintStyle, getHoverAlign, getHoverDelay, getHoverFocusKey, getHoverHeight, getHoverHeightAsString, getHoverOpacity, getHoverPersist, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWidthAsString, getIcon, getIconBaseStyle, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIcons, getIconTabPosition, getIconVAlign, getIconWidth, getID, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLinearColSpan, getLinearColSpanAsString, getLinearEndRow, getLinearEndRowAsString, getLinearStartRow, getLinearStartRowAsString, getLinearWidth, getLinearWidthAsString, getListGrid, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultipleValueSeparator, getName, getNullOriginalValueText, getOperator, getOptionCriteria, getOptionDataSourceAsString, getOptionFilterContext, getOptionTextMatchStyle, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPaletteDefaults, getPicker, getPickerIcon, getPickerIcon, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconTabPosition, getPixelHeight, getPixelWidth, getPrintReadOnlyTextBoxStyle, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyCanSelectText, getReadOnlyControlStyle, getReadOnlyDisplay, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredWhen, getRowSpan, getScClassName, getSelectOnClick, getSelectOnFocus, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowDisabledIconsOnFocus, getShowDisabledPickerIconOnFocus, getShowErrorIcon, getShowErrorIconInline, getShowErrorStyle, getShowErrorText, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowIconsOnFocus, getShowImageAsURL, getShowOldValueInHover, getShowOverIcons, getShowPending, getShowPickerIconOnFocus, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getStoreDisplayValues, getSupportsCutPasteEvents, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextFormula, getTimeFormatter, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getUpdatePickerIconOnOver, getUseAdvancedCriteria, getUseDisabledHintStyleForReadOnly, getUseLocalDisplayFieldValue, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsRecordList, getValueDeselectedCSSText, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getValueMap, getValueMapAsArray, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapHintText, getWrapStaticValue, getWrapTitle, handleWarnOnEditorTypeConversion, hasAdvancedCriteria, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isAssignableFrom, isConfigOnly, isCreated, isCutEvent, isDisabled, isDrawn, isFocused, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, removeIcon, selectedRecordChanged, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAlwaysShowControlBox, setApplyAlignToText, setApplyHeightToTextBox, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setAutoCompleteKeywords, setBrowserInputType, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanEditOpaqueValues, setCanFocus, setCanHover, setCanTabToIcons, setCellHeight, setCellStyle, setChangeOnKeypress, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setConfigOnly, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, setCustomStateGetter, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultOperator, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisabledHover, setDisableIconsOnReadOnly, setDisplayFormat, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconProperties, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setExportFormat, setFetchMissingValues, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHeight, setHeight, setHidden, setHintStyle, setHoverAlign, setHoverDelay, setHoverFocusKey, setHoverHeight, setHoverHeight, setHoverOpacity, setHoverPersist, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWidth, setIconBaseStyle, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconShowOnFocus, setIconVAlign, setIconWidth, setID, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLinearColSpan, setLinearColSpan, setLinearEndRow, setLinearEndRow, setLinearStartRow, setLinearStartRow, setLinearWidth, setLinearWidth, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultipleValueSeparator, setName, setNullOriginalValueText, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionTextMatchStyle, setOriginalValueMessage, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPrintReadOnlyTextBoxStyle, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyCanSelectText, setReadOnlyControlStyle, setReadOnlyDisplay, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredWhen, setRowSpan, setScClassName, setSelectOnClick, setSelectOnFocus, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowDisabledIconsOnFocus, setShowDisabledPickerIconOnFocus, setShowErrorIcon, setShowErrorIconInline, setShowErrorStyle, setShowErrorText, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIconsOnFocus, setShowIfCondition, setShowImageAsURL, setShowOldValueInHover, setShowOverIcons, setShowPending, setShowPickerIconOnFocus, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setStoreDisplayValues, setSupportsCutPasteEvents, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextFormula, setTimeFormatter, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setUpdatePickerIconOnOver, setUseAdvancedCriteria, setUseDisabledHintStyleForReadOnly, setUseLocalDisplayFieldValue, setUseObjectFactoryForTypeFallback, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueDeselectedCSSText, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapHintText, setWrapStaticValue, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, stopHover, storeValue, storeValue, updateState, validate, valueClippedMethods inherited from class com.smartgwt.client.data.Field
getCanExport, getExportTitle, getPrimaryKey, getSortByField, setCanExport, setExportTitle, setPrimaryKey, setSortByFieldMethods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreatedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
SavedSearchItem
public SavedSearchItem() -
SavedSearchItem
-
SavedSearchItem
-
SavedSearchItem
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName.- Parameters:
autoChildName- name of an AutoChild to customize the defaults for.defaults- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName.- Parameters:
autoChildName- name of an AutoChild to customize the defaults for.defaults- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties.- See Also:
-
changePickerIconDefaults
-
setAddSearchIcon
Icon to be used to show theEditSearchWindow.- Parameters:
addSearchIcon- New addSearchIcon value. Default value is "[SKINIMG]actions/add.png"- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getAddSearchIcon
Icon to be used to show theEditSearchWindow.- Returns:
- Current addSearchIcon value. Default value is "[SKINIMG]actions/add.png"
- See Also:
-
setAddSearchValue
Setting this property moves thecanAddSearchfunctionality from an icon next to the form item (addSearchIcon) to the dropdown. When set, the SavedSearchItem will look for this value inspecialValuesand use it as the trigger action forcanAddSearch.- Parameters:
addSearchValue- New addSearchValue value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getAddSearchValue
Setting this property moves thecanAddSearchfunctionality from an icon next to the form item (addSearchIcon) to the dropdown. When set, the SavedSearchItem will look for this value inspecialValuesand use it as the trigger action forcanAddSearch.- Returns:
- Current addSearchValue value. Default value is null
-
setAdminRole
Role to check for (viaAuthentication.hasRole()to determine whether admin interfaces are shown. If not explicitly set, at initialization time this will be defaulted toSavedSearches.adminRole.- Parameters:
adminRole- New adminRole value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getAdminRole
Role to check for (viaAuthentication.hasRole()to determine whether admin interfaces are shown. If not explicitly set, at initialization time this will be defaulted toSavedSearches.adminRole.- Returns:
- Current adminRole value. Default value is null
-
getAdminSeparatorRecord
Properties for the separator record between locally saved and admin searches.This component is an AutoChild named "adminSeparatorRecord". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current adminSeparatorRecord value. Default value is {isSeparator:true}
-
setCanAddSearch
This flag controls whether adding new searches is allowed.- Parameters:
canAddSearch- New canAddSearch value. Default value is false- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCanAddSearch
public boolean getCanAddSearch()This flag controls whether adding new searches is allowed.- Returns:
- Current canAddSearch value. Default value is false
-
setCanCopySearch
Whether existing searches can be copied.If no explicit value is set, it will be defaulted to
falseif thetarget is a grid. Searches can be copied by simply selecting them, using the grid's standard UI to edit the search, and then saving that as a new search.- Parameters:
canCopySearch- New canCopySearch value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCanCopySearch
Whether existing searches can be copied.If no explicit value is set, it will be defaulted to
falseif thetarget is a grid. Searches can be copied by simply selecting them, using the grid's standard UI to edit the search, and then saving that as a new search.- Returns:
- Current canCopySearch value. Default value is null
-
setCanEditSearch
Whether existing searches can be edited.If no explicit value is set, it will be defaulted to
falseif thetarget is a grid. Searches can be edited by simply selecting them, using the grid's standard UI to edit the search, and then saving that as the original search.- Parameters:
canEditSearch- New canEditSearch value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCanEditSearch
Whether existing searches can be edited.If no explicit value is set, it will be defaulted to
falseif thetarget is a grid. Searches can be edited by simply selecting them, using the grid's standard UI to edit the search, and then saving that as the original search.- Returns:
- Current canEditSearch value. Default value is null
-
setCanModifyProperty
Optional name of a boolean field in the records returned by theoptionDataSource, where setting the field tofalsemeans the Record cannot be edited or removed by the current user.- Parameters:
canModifyProperty- New canModifyProperty value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCanModifyProperty
Optional name of a boolean field in the records returned by theoptionDataSource, where setting the field tofalsemeans the Record cannot be edited or removed by the current user.- Returns:
- Current canModifyProperty value. Default value is null
-
setCanRemoveSearch
Whether existing searches can be removed.- Parameters:
canRemoveSearch- New canRemoveSearch value. Default value is true- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCanRemoveSearch
public boolean getCanRemoveSearch()Whether existing searches can be removed.- Returns:
- Current canRemoveSearch value. Default value is true
-
setConfirmRemoval
Whether a confirmation message should be shown when a user removes a saved search. The message shown is theconfirmRemovalMessage.- Parameters:
confirmRemoval- New confirmRemoval value. Default value is true- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getConfirmRemoval
public boolean getConfirmRemoval()Whether a confirmation message should be shown when a user removes a saved search. The message shown is theconfirmRemovalMessage.- Returns:
- Current confirmRemoval value. Default value is true
-
setConfirmRemovalMessage
Message shown whenremoval confirmationis enabled and user attempts to remove a saved search. The variable "${title}" is available providing the display name of the saved search.- Parameters:
confirmRemovalMessage- New confirmRemovalMessage value. Default value is "Remove saved view '${title}'?"- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getConfirmRemovalMessage
Message shown whenremoval confirmationis enabled and user attempts to remove a saved search. The variable "${title}" is available providing the display name of the saved search.- Returns:
- Current confirmRemovalMessage value. Default value is "Remove saved view '${title}'?"
- See Also:
-
getCopySearchField
ListGridField shown in the pickList to allow users to copy existing searches. The field is type "icon" and displays the skin's standard "copy" icon.This component is an AutoChild named "copySearchField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current copySearchField value. Default value is null
-
setCopySearchHoverText
Hover text that appeares over the +{copySearchField}- Parameters:
copySearchHoverText- New copySearchHoverText value. Default value is "Copy view"- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getCopySearchHoverText
Hover text that appeares over the +{copySearchField}- Returns:
- Current copySearchHoverText value. Default value is "Copy view"
-
setDefaultSearchNameSuffix
HTML string to append to the search title in the search name field if this is the default search.- Parameters:
defaultSearchNameSuffix- New defaultSearchNameSuffix value. Default value is "<i>[default]</i>"- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getDefaultSearchNameSuffix
HTML string to append to the search title in the search name field if this is the default search.- Returns:
- Current defaultSearchNameSuffix value. Default value is "<i>[default]</i>"
- See Also:
-
setEditProxyConstructor
Default class used to construct theEditProxyfor this component when the component isfirst placed into edit mode.- Overrides:
setEditProxyConstructorin classSelectItem- Parameters:
editProxyConstructor- New editProxyConstructor value. Default value is "SavedSearchItemEditProxy"- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getEditProxyConstructor
Default class used to construct theEditProxyfor this component when the component isfirst placed into edit mode.- Overrides:
getEditProxyConstructorin classSelectItem- Returns:
- Current editProxyConstructor value. Default value is "SavedSearchItemEditProxy"
- See Also:
-
getEditSearchField
ListGridField shown in the pickList to allow users to edit existing searches. The field is type "icon" and displays the skin's standard "edit" icon.Does not appear if the
target is a grid, since the simplest way of editing a search is just to select it, use the grid's built-in criteria editing to change it, and save as new.Specific records can be marked as unable to be edited via
canModifyProperty.This component is an AutoChild named "editSearchField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current editSearchField value. Default value is null
-
setEditSearchHoverText
Hover text that appeares over the +{editSearchField}- Parameters:
editSearchHoverText- New editSearchHoverText value. Default value is "Save View Configuration"- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getEditSearchHoverText
Hover text that appeares over the +{editSearchField}- Returns:
- Current editSearchHoverText value. Default value is "Save View Configuration"
-
getEditSearchWindow
Modal pop-up window shown when the user adds or edits a search, instance of ofEditSearchWindow.This component is an AutoChild named "editSearchWindow". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current editSearchWindow value. Default value is null
-
setHint
Text shown inside the field that serves as an indicator of what this field is for.- Overrides:
setHintin classFormItem- Parameters:
hint- New hint value. Default value is "Saved views..."- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getHint
Text shown inside the field that serves as an indicator of what this field is for. -
getMarkAsAdminDefaultField
ListGridField shown in the pickList to allow admin users to designate which field is the admin-default search. The field is type "icon" and displays the skin's standard "checkbox" media.This component is an AutoChild named "markAsAdminDefaultField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current markAsAdminDefaultField value. Default value is null
-
setMarkAsAdminDefaultHoverText
Hover text that appeares over the +{markAsAdminDefaultField}- Parameters:
markAsAdminDefaultHoverText- New markAsAdminDefaultHoverText value. Default value is "Set as default view for all users<br><br><i>[May be overridden by users' own preferences.]</i>"- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getMarkAsAdminDefaultHoverText
Hover text that appeares over the +{markAsAdminDefaultField}- Returns:
- Current markAsAdminDefaultHoverText value. Default value is "Set as default view for all users<br><br><i>[May be overridden by users' own preferences.]</i>"
-
getMarkAsDefaultField
ListGridField shown in the pickList to allow users to designate which field is the default search. The field is type "icon" and displays the skin's standard "checkbox" media.This component is an AutoChild named "markAsDefaultField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current markAsDefaultField value. Default value is null
-
setMarkAsDefaultHoverText
Hover text that appeares over the +{markAsDefaultField}- Parameters:
markAsDefaultHoverText- New markAsDefaultHoverText value. Default value is "Set as default view"- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getMarkAsDefaultHoverText
Hover text that appeares over the +{markAsDefaultField}- Returns:
- Current markAsDefaultHoverText value. Default value is "Set as default view"
-
setNewRecordValues
Additional, fixed Record values that should be used every time a new search is saved.This can be used to create user-specific saved searches by adding the userId as part of the saved Record's value.
Since this property is settable on the fly, you could also add an external interface that would allow a user to save system-wide searches that are not associated with their userId. For example, system-wide searches might have userId set to blank or to a special marker value, and the
SelectItem.optionCriteriacould be set so that theSavedSearchItemshows system-wide as well as user-specific saved searches.- Parameters:
newRecordValues- New newRecordValues value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getNewRecordValues
Additional, fixed Record values that should be used every time a new search is saved.This can be used to create user-specific saved searches by adding the userId as part of the saved Record's value.
Since this property is settable on the fly, you could also add an external interface that would allow a user to save system-wide searches that are not associated with their userId. For example, system-wide searches might have userId set to blank or to a special marker value, and the
SelectItem.optionCriteriacould be set so that theSavedSearchItemshows system-wide as well as user-specific saved searches.- Returns:
- Current newRecordValues value. Default value is null
-
setOfflineStorageKey
Optional key used for local storage of saved searches by this component.If unset, the default
SavedSearches.offlineStorageKeywill be used for local storage instead.Has no effect if
savedSearchDSis set.- Parameters:
offlineStorageKey- New offlineStorageKey value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getOfflineStorageKey
Optional key used for local storage of saved searches by this component.If unset, the default
SavedSearches.offlineStorageKeywill be used for local storage instead.Has no effect if
savedSearchDSis set.- Returns:
- Current offlineStorageKey value. Default value is null
-
getPickListFields
The SavedSearchItem pickListFields are automatically generated and contain fields for the search name plus the search description, plus additional columns for icons for editing, removal, copying existing searches, and choosing a default search.- Overrides:
getPickListFieldsin classSelectItem- Returns:
- Current pickListFields value. Default value is [...]
- See Also:
-
getRemoveSearchField
ListGridField shown in the pickList to allow users to remove existing searches. The field is type "icon" and displays the skin's standard "remove" icon.An optional confirmation dialog is shown if
confirmRemovalis set.By default, if a record is an admin search (because it has no value for
SavedSearches.userIdFieldor becauseSavedSearches.adminFieldis true on the record), only an admin will be able to delete it.Alternatively, if you are not using the
SavedSearchItem's admin features, specific records can be marked as unable to be removed viacanModifyProperty.This component is an AutoChild named "removeSearchField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Returns:
- Current removeSearchField value. Default value is null
-
setRemoveSearchHoverText
Hover text that appeares over the +{removeSearchField}- Parameters:
removeSearchHoverText- New removeSearchHoverText value. Default value is "Remove view"- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getRemoveSearchHoverText
Hover text that appeares over the +{removeSearchField}- Returns:
- Current removeSearchHoverText value. Default value is "Remove view"
-
setSaveDefaultSearch
Works identically toListGrid.saveDefaultSearch. The default is stored in browserlocalStorageusing thesavedSearchIdof thetargetComponent, or a combination of thelocal or global IDand DataSource ID if no savedSearchId was specified (see documentation forsavedSearchIdfor details).If no targetComponent is specified, the savedSearchId or minimal locator of the
SavedSearchItemitself will be used.Note that if the targetComponent is
ListGrid.autoFetchData, and saveDefaultSearch is true, the SavedSearchItem automatically registers with the target component to prevent an automatic fetch with default criteria, and then, after looking up the default search, will perform either the default search or perform a standard autoFetch if no default search is found.- Parameters:
saveDefaultSearch- New saveDefaultSearch value. Default value is true- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getSaveDefaultSearch
public boolean getSaveDefaultSearch()Works identically toListGrid.saveDefaultSearch. The default is stored in browserlocalStorageusing thesavedSearchIdof thetargetComponent, or a combination of thelocal or global IDand DataSource ID if no savedSearchId was specified (see documentation forsavedSearchIdfor details).If no targetComponent is specified, the savedSearchId or minimal locator of the
SavedSearchItemitself will be used.Note that if the targetComponent is
ListGrid.autoFetchData, and saveDefaultSearch is true, the SavedSearchItem automatically registers with the target component to prevent an automatic fetch with default criteria, and then, after looking up the default search, will perform either the default search or perform a standard autoFetch if no default search is found.- Returns:
- Current saveDefaultSearch value. Default value is true
-
setSavedSearchDS
Optional override ofSavedSearches.defaultDataSourcefor this SavedSearchItem.- Parameters:
savedSearchDS- New savedSearchDS value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getSavedSearchDS
Optional override ofSavedSearches.defaultDataSourcefor this SavedSearchItem.- Returns:
- Current savedSearchDS value. Default value is null
-
setSavedSearchId
Optional explicit identifier for saved searches. SeesaveDefaultSearchfor details.Note : This is an advanced setting
- Parameters:
savedSearchId- New savedSearchId value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getSavedSearchId
Optional explicit identifier for saved searches. SeesaveDefaultSearchfor details.- Returns:
- Current savedSearchId value. Default value is null
-
setSaveLastSearch
If set, the name of the last search is automatically stored in browserlocalStorage, and will be applied to thetargetComponentas soon as saved searches are loaded.- Parameters:
saveLastSearch- New saveLastSearch value. Default value is false- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getSaveLastSearch
public boolean getSaveLastSearch()If set, the name of the last search is automatically stored in browserlocalStorage, and will be applied to thetargetComponentas soon as saved searches are loaded.- Returns:
- Current saveLastSearch value. Default value is false
-
setStoredState
Set to "criteria" if you want only criteria to be stored for ListGrids and TreeGrids instead of the full viewState of the component.- Parameters:
storedState- New storedState value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getStoredState
Set to "criteria" if you want only criteria to be stored for ListGrids and TreeGrids instead of the full viewState of the component.- Returns:
- Current storedState value. Default value is null
- See Also:
-
setTargetComponent
Component that saved searches should apply to. When set, wheneversearchChanged()fires, the search is automatically applied to thetargetComponentunless thesearchChangedevent is cancelled.To avoid leaking local storage, saving searches will not be allowed for the target grid unless it specifies
savedSearchId, or an explicitlocal or global IDis present.
If this method is called after the component has been drawn/initialized: Changes thetargetComponentto the passed in newTargetComponent.- Parameters:
targetComponent- the newTargetComponent. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getTargetComponent
Component that saved searches should apply to. When set, wheneversearchChanged()fires, the search is automatically applied to thetargetComponentunless thesearchChangedevent is cancelled.To avoid leaking local storage, saving searches will not be allowed for the target grid unless it specifies
savedSearchId, or an explicitlocal or global IDis present.- Returns:
- Current targetComponent value. Default value is null
-
setTargetDataSource
DataSource that the saved searches are performed against.Normally auto-derived from
targetComponent.dataSource, but can be specified manually if notargetComponentis provided. In this case,searchChanged()would be implement to apply criteria in a custom way.- Parameters:
targetDataSource- New targetDataSource value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getTargetDataSource
DataSource that the saved searches are performed against.Normally auto-derived from
targetComponent.dataSource, but can be specified manually if notargetComponentis provided. In this case,searchChanged()would be implement to apply criteria in a custom way.- Returns:
- Current targetDataSource value. Default value is null
-
setTargetEditsCriteria
Whether thetargetComponenthas built-in criteria editing or does not. True by default if the target is aListGridorTreeGrid(but notCubeGrid).When the target has built-in criteria editing, the
SavedSearchItemdoes not try to provide aFilterBuilder-based criteria editing interface, so theSavedSearchEditoris simplified to just allow naming of searches.- Parameters:
targetEditsCriteria- New targetEditsCriteria value. Default value is null- Returns:
SavedSearchIteminstance, for chaining setter calls
-
getTargetEditsCriteria
Whether thetargetComponenthas built-in criteria editing or does not. True by default if the target is aListGridorTreeGrid(but notCubeGrid).When the target has built-in criteria editing, the
SavedSearchItemdoes not try to provide aFilterBuilder-based criteria editing interface, so theSavedSearchEditoris simplified to just allow naming of searches.- Returns:
- Current targetEditsCriteria value. Default value is null
-
setTitle
Title of this FormItem. Mote that the title is hidden by default for SavedSearchItem.- Overrides:
setTitlein classFormItem- Parameters:
title- New title value. Default value is "Views"- Returns:
SavedSearchIteminstance, for chaining setter calls- See Also:
-
getTitle
Title of this FormItem. Mote that the title is hidden by default for SavedSearchItem. -
searchChanged
Event fired whenever a user changes the currently selected saved search, modifies a saved search or adds a new saved search.If a
targetComponenthas been specified,searchChangedautomatically applies the new search to thetargetComponentunless the event is cancelled .- Parameters:
newCriteria- new criteriasearchData- savedSearch record- Returns:
- whether to automatically apply the search to the
targetComponent
-
setDefaultProperties
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
- Parameters:
savedSearchItemProperties- properties that should be used as new defaults when instances of this class are created- See Also:
-