public class SavedSearchItem extends SelectItem
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()
.
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.
FormItem.CustomStateGetter, FormItem.StateCustomizer
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefault
id
factoryCreated, factoryProperties
Constructor and Description |
---|
SavedSearchItem() |
SavedSearchItem(com.google.gwt.core.client.JavaScriptObject jsObj) |
SavedSearchItem(java.lang.String name) |
SavedSearchItem(java.lang.String name,
java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
Canvas defaults)
Changes the defaults for Canvas AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
FormItem defaults)
Changes the defaults for FormItem AutoChildren named
autoChildName . |
static void |
changePickerIconDefaults(FormItemIcon defaults) |
java.lang.String |
getAddSearchIcon()
Icon to be used to show the
EditSearchWindow . |
java.lang.String |
getAddSearchValue()
Setting this property moves the
canAddSearch functionality from an icon next to the form item (addSearchIcon ) to the dropdown. |
java.lang.String |
getAdminRole()
Role to check for (via
Authentication.hasRole() to determine
whether admin interfaces are shown. |
ListGridRecord |
getAdminSeparatorRecord()
Properties for the separator record between locally saved and admin searches.
|
boolean |
getCanAddSearch()
This flag controls whether adding new searches is allowed.
|
java.lang.Boolean |
getCanCopySearch()
Whether existing searches can be copied.
|
java.lang.Boolean |
getCanEditSearch()
Whether existing searches can be edited.
|
java.lang.String |
getCanModifyProperty()
Optional name of a boolean field in the records returned by the
optionDataSource , where setting the field
to false means the Record cannot be edited or removed by the current user. |
boolean |
getCanRemoveSearch()
Whether existing searches can be removed.
|
boolean |
getConfirmRemoval()
Whether a confirmation message should be shown when a user removes a saved search.
|
java.lang.String |
getConfirmRemovalMessage()
Message shown when
removal
confirmation is enabled and user attempts to remove a saved search. |
ListGridField |
getCopySearchField()
ListGridField shown in the pickList to allow users to copy existing searches.
|
java.lang.String |
getCopySearchHoverText()
Hover text that appeares over the +{copySearchField}
|
java.lang.String |
getDefaultSearchNameSuffix()
HTML string to append to the search title in the search name field if this is the default search.
|
java.lang.String |
getEditProxyConstructor()
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
ListGridField |
getEditSearchField()
ListGridField shown in the pickList to allow users to edit existing searches.
|
java.lang.String |
getEditSearchHoverText()
Hover text that appeares over the +{editSearchField}
|
EditSearchWindow |
getEditSearchWindow()
Modal pop-up window shown when the user adds or edits a search, instance of of
EditSearchWindow . |
java.lang.String |
getHint()
Text shown inside the field that serves as an indicator of what this field is for.
|
ListGridField |
getMarkAsAdminDefaultField()
ListGridField shown in the pickList to allow admin users to designate which field is the admin-default search.
|
java.lang.String |
getMarkAsAdminDefaultHoverText()
Hover text that appeares over the +{markAsAdminDefaultField}
|
ListGridField |
getMarkAsDefaultField()
ListGridField shown in the pickList to allow users to designate which field is the default search.
|
java.lang.String |
getMarkAsDefaultHoverText()
Hover text that appeares over the +{markAsDefaultField}
|
Record |
getNewRecordValues()
Additional, fixed Record values that should be used every time a new search is saved.
|
java.lang.String |
getOfflineStorageKey()
Optional key used for local storage of saved searches by this component.
|
static SavedSearchItem |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
ListGridField[] |
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.
|
ListGridField |
getRemoveSearchField()
ListGridField shown in the pickList to allow users to remove existing searches.
|
java.lang.String |
getRemoveSearchHoverText()
Hover text that appeares over the +{removeSearchField}
|
boolean |
getSaveDefaultSearch()
Works identically to
ListGrid.saveDefaultSearch . |
java.lang.String |
getSavedSearchDS()
Optional override of
SavedSearches.defaultDataSource
for this SavedSearchItem. |
java.lang.String |
getSavedSearchId()
Optional explicit identifier for saved searches.
|
boolean |
getSaveLastSearch()
If 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. |
SavedSearchStoredState |
getStoredState()
Set to "criteria" if you want only criteria to be stored for ListGrids and TreeGrids instead of the full viewState of
the component.
|
DataBoundComponent |
getTargetComponent()
Component that saved searches should apply to.
|
DataSource |
getTargetDataSource()
DataSource that the saved searches are performed against.
|
java.lang.Boolean |
getTargetEditsCriteria()
Whether the
targetComponent has
built-in criteria editing or does not. |
java.lang.String |
getTitle()
Title of this FormItem.
|
boolean |
searchChanged(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.
|
SavedSearchItem |
setAddSearchIcon(java.lang.String addSearchIcon)
Icon to be used to show the
EditSearchWindow . |
SavedSearchItem |
setAddSearchValue(java.lang.String addSearchValue)
Setting this property moves the
canAddSearch functionality from an icon next to the form item (addSearchIcon ) to the dropdown. |
SavedSearchItem |
setAdminRole(java.lang.String adminRole)
Role to check for (via
Authentication.hasRole() to determine
whether admin interfaces are shown. |
SavedSearchItem |
setCanAddSearch(boolean canAddSearch)
This flag controls whether adding new searches is allowed.
|
SavedSearchItem |
setCanCopySearch(java.lang.Boolean canCopySearch)
Whether existing searches can be copied.
|
SavedSearchItem |
setCanEditSearch(java.lang.Boolean canEditSearch)
Whether existing searches can be edited.
|
SavedSearchItem |
setCanModifyProperty(java.lang.String canModifyProperty)
Optional name of a boolean field in the records returned by the
optionDataSource , where setting the field
to false means the Record cannot be edited or removed by the current user. |
SavedSearchItem |
setCanRemoveSearch(boolean canRemoveSearch)
Whether existing searches can be removed.
|
SavedSearchItem |
setConfirmRemoval(boolean confirmRemoval)
Whether a confirmation message should be shown when a user removes a saved search.
|
SavedSearchItem |
setConfirmRemovalMessage(java.lang.String confirmRemovalMessage)
Message shown when
removal
confirmation is enabled and user attempts to remove a saved search. |
SavedSearchItem |
setCopySearchHoverText(java.lang.String copySearchHoverText)
Hover text that appeares over the +{copySearchField}
|
static void |
setDefaultProperties(SavedSearchItem savedSearchItemProperties)
Class level method to set the default properties of this class.
|
SavedSearchItem |
setDefaultSearchNameSuffix(java.lang.String defaultSearchNameSuffix)
HTML string to append to the search title in the search name field if this is the default search.
|
SavedSearchItem |
setEditProxyConstructor(java.lang.String editProxyConstructor)
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
SavedSearchItem |
setEditSearchHoverText(java.lang.String editSearchHoverText)
Hover text that appeares over the +{editSearchField}
|
SavedSearchItem |
setHint(java.lang.String hint)
Text shown inside the field that serves as an indicator of what this field is for.
|
SavedSearchItem |
setMarkAsAdminDefaultHoverText(java.lang.String markAsAdminDefaultHoverText)
Hover text that appeares over the +{markAsAdminDefaultField}
|
SavedSearchItem |
setMarkAsDefaultHoverText(java.lang.String markAsDefaultHoverText)
Hover text that appeares over the +{markAsDefaultField}
|
SavedSearchItem |
setNewRecordValues(Record newRecordValues)
Additional, fixed Record values that should be used every time a new search is saved.
|
SavedSearchItem |
setOfflineStorageKey(java.lang.String offlineStorageKey)
Optional key used for local storage of saved searches by this component.
|
SavedSearchItem |
setRemoveSearchHoverText(java.lang.String removeSearchHoverText)
Hover text that appeares over the +{removeSearchField}
|
SavedSearchItem |
setSaveDefaultSearch(boolean saveDefaultSearch)
Works identically to
ListGrid.saveDefaultSearch . |
SavedSearchItem |
setSavedSearchDS(java.lang.String savedSearchDS)
Optional override of
SavedSearches.defaultDataSource
for this SavedSearchItem. |
SavedSearchItem |
setSavedSearchId(java.lang.String savedSearchId)
Optional explicit identifier for saved searches.
|
SavedSearchItem |
setSaveLastSearch(boolean saveLastSearch)
If 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. |
SavedSearchItem |
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.
|
SavedSearchItem |
setTargetComponent(DataBoundComponent targetComponent)
Component that saved searches should apply to.
|
SavedSearchItem |
setTargetDataSource(DataSource targetDataSource)
DataSource that the saved searches are performed against.
|
SavedSearchItem |
setTargetEditsCriteria(java.lang.Boolean targetEditsCriteria)
Whether the
targetComponent has
built-in criteria editing or does not. |
SavedSearchItem |
setTitle(java.lang.String title)
Title of this FormItem.
|
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, showPicker
_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, 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, 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, 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, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, stopHover, storeValue, storeValue, updateState, validate, valueClipped
getCanExport, getExportTitle, getSortByField, setCanExport, setExportTitle, setSortByField
getRef, getRef, internalSetID
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
public SavedSearchItem()
public SavedSearchItem(com.google.gwt.core.client.JavaScriptObject jsObj)
public SavedSearchItem(java.lang.String name)
public SavedSearchItem(java.lang.String name, java.lang.String title)
public static SavedSearchItem getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
public static void changePickerIconDefaults(FormItemIcon defaults)
public SavedSearchItem setAddSearchIcon(java.lang.String addSearchIcon)
EditSearchWindow
.addSearchIcon
- New addSearchIcon value. Default value is "[SKINIMG]actions/add.png"SavedSearchItem
instance, for chaining setter callsSCImgURL
public java.lang.String getAddSearchIcon()
EditSearchWindow
.SCImgURL
public SavedSearchItem setAddSearchValue(java.lang.String addSearchValue)
canAddSearch
functionality from an icon next to the form item (addSearchIcon
) to the dropdown. When set, the
SavedSearchItem will look for this value in specialValues
and use it as the trigger action for canAddSearch
.addSearchValue
- New addSearchValue value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getAddSearchValue()
canAddSearch
functionality from an icon next to the form item (addSearchIcon
) to the dropdown. When set, the
SavedSearchItem will look for this value in specialValues
and use it as the trigger action for canAddSearch
.public SavedSearchItem setAdminRole(java.lang.String adminRole)
Authentication.hasRole()
to determine
whether admin interfaces are shown. If not explicitly set, at initialization time this will be defaulted to SavedSearches.adminRole
.adminRole
- New adminRole value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getAdminRole()
Authentication.hasRole()
to determine
whether admin interfaces are shown. If not explicitly set, at initialization time this will be defaulted to SavedSearches.adminRole
.public ListGridRecord getAdminSeparatorRecord()
This component is an AutoChild named "adminSeparatorRecord". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setCanAddSearch(boolean canAddSearch)
canAddSearch
- New canAddSearch value. Default value is falseSavedSearchItem
instance, for chaining setter callspublic boolean getCanAddSearch()
public SavedSearchItem setCanCopySearch(java.lang.Boolean canCopySearch)
If no explicit value is set, it will be defaulted to false
if
the target 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.
canCopySearch
- New canCopySearch value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.Boolean getCanCopySearch()
If no explicit value is set, it will be defaulted to false
if
the target 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.
public SavedSearchItem setCanEditSearch(java.lang.Boolean canEditSearch)
If no explicit value is set, it will be defaulted to false
if
the target 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.
canEditSearch
- New canEditSearch value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.Boolean getCanEditSearch()
If no explicit value is set, it will be defaulted to false
if
the target 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.
public SavedSearchItem setCanModifyProperty(java.lang.String canModifyProperty)
optionDataSource
, where setting the field
to false
means the Record cannot be edited or removed by the current user.canModifyProperty
- New canModifyProperty value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getCanModifyProperty()
optionDataSource
, where setting the field
to false
means the Record cannot be edited or removed by the current user.public SavedSearchItem setCanRemoveSearch(boolean canRemoveSearch)
canRemoveSearch
- New canRemoveSearch value. Default value is trueSavedSearchItem
instance, for chaining setter callspublic boolean getCanRemoveSearch()
public SavedSearchItem setConfirmRemoval(boolean confirmRemoval)
confirmRemovalMessage
.confirmRemoval
- New confirmRemoval value. Default value is trueSavedSearchItem
instance, for chaining setter callspublic boolean getConfirmRemoval()
confirmRemovalMessage
.public SavedSearchItem setConfirmRemovalMessage(java.lang.String confirmRemovalMessage)
removal
confirmation
is enabled and user attempts to remove a saved search. The variable "${title}" is available providing the
display name of the saved search.confirmRemovalMessage
- New confirmRemovalMessage value. Default value is "Remove saved view '${title}'?"SavedSearchItem
instance, for chaining setter callsHTMLString
public java.lang.String getConfirmRemovalMessage()
removal
confirmation
is enabled and user attempts to remove a saved search. The variable "${title}" is available providing the
display name of the saved search.HTMLString
public ListGridField getCopySearchField()
This component is an AutoChild named "copySearchField". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setCopySearchHoverText(java.lang.String copySearchHoverText)
copySearchHoverText
- New copySearchHoverText value. Default value is "Copy view"SavedSearchItem
instance, for chaining setter callspublic java.lang.String getCopySearchHoverText()
public SavedSearchItem setDefaultSearchNameSuffix(java.lang.String defaultSearchNameSuffix)
defaultSearchNameSuffix
- New defaultSearchNameSuffix value. Default value is "<i>[default]</i>"SavedSearchItem
instance, for chaining setter callsHTMLString
public java.lang.String getDefaultSearchNameSuffix()
HTMLString
public SavedSearchItem setEditProxyConstructor(java.lang.String editProxyConstructor)
EditProxy
for this component when the component is
first placed into edit mode
.setEditProxyConstructor
in class SelectItem
editProxyConstructor
- New editProxyConstructor value. Default value is "SavedSearchItemEditProxy"SavedSearchItem
instance, for chaining setter callsSCClassName
public java.lang.String getEditProxyConstructor()
EditProxy
for this component when the component is
first placed into edit mode
.getEditProxyConstructor
in class SelectItem
SCClassName
public ListGridField getEditSearchField()
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
.
public SavedSearchItem setEditSearchHoverText(java.lang.String editSearchHoverText)
editSearchHoverText
- New editSearchHoverText value. Default value is "Save View Configuration"SavedSearchItem
instance, for chaining setter callspublic java.lang.String getEditSearchHoverText()
public EditSearchWindow getEditSearchWindow()
EditSearchWindow
.
This component is an AutoChild named "editSearchWindow". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setHint(java.lang.String hint)
setHint
in class FormItem
hint
- New hint value. Default value is "Saved views..."SavedSearchItem
instance, for chaining setter callsFormItem.setHintStyle(java.lang.String)
,
HTMLString
,
Appearance overview and related methods
,
Hints Examplepublic java.lang.String getHint()
getHint
in class FormItem
FormItem.getHintStyle()
,
HTMLString
,
Appearance overview and related methods
,
Hints Examplepublic ListGridField getMarkAsAdminDefaultField()
This component is an AutoChild named "markAsAdminDefaultField". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setMarkAsAdminDefaultHoverText(java.lang.String markAsAdminDefaultHoverText)
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>"SavedSearchItem
instance, for chaining setter callspublic java.lang.String getMarkAsAdminDefaultHoverText()
public ListGridField getMarkAsDefaultField()
This component is an AutoChild named "markAsDefaultField". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setMarkAsDefaultHoverText(java.lang.String markAsDefaultHoverText)
markAsDefaultHoverText
- New markAsDefaultHoverText value. Default value is "Set as default view"SavedSearchItem
instance, for chaining setter callspublic java.lang.String getMarkAsDefaultHoverText()
public SavedSearchItem setNewRecordValues(Record newRecordValues)
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.optionCriteria
could be set so that the SavedSearchItem
shows system-wide as well as
user-specific saved searches.
newRecordValues
- New newRecordValues value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic Record getNewRecordValues()
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.optionCriteria
could be set so that the SavedSearchItem
shows system-wide as well as
user-specific saved searches.
public SavedSearchItem setOfflineStorageKey(java.lang.String offlineStorageKey)
If unset, the default SavedSearches.offlineStorageKey
will be used for local
storage instead.
Has no effect if savedSearchDS
is set.
offlineStorageKey
- New offlineStorageKey value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getOfflineStorageKey()
If unset, the default SavedSearches.offlineStorageKey
will be used for local
storage instead.
Has no effect if savedSearchDS
is set.
public ListGridField[] getPickListFields()
getPickListFields
in class SelectItem
SelectItem.getValueField()
,
PickList overview and related methods
,
List - Related Records Examplepublic ListGridField getRemoveSearchField()
An optional confirmation dialog is shown if confirmRemoval
is set.
By default, if a
record is an admin search (because it has no value for SavedSearches.userIdField
or because SavedSearches.adminField
is 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 via
canModifyProperty
.
This component is an AutoChild named "removeSearchField". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
public SavedSearchItem setRemoveSearchHoverText(java.lang.String removeSearchHoverText)
removeSearchHoverText
- New removeSearchHoverText value. Default value is "Remove view"SavedSearchItem
instance, for chaining setter callspublic java.lang.String getRemoveSearchHoverText()
public SavedSearchItem setSaveDefaultSearch(boolean saveDefaultSearch)
ListGrid.saveDefaultSearch
.
The default is stored in browser localStorage
using the savedSearchId
of the targetComponent
, or a combination of the
local or global ID
and DataSource ID if no savedSearchId was
specified (see documentation for savedSearchId
for details). If no targetComponent is specified, the savedSearchId or minimal locator of the
SavedSearchItem
itself 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.
saveDefaultSearch
- New saveDefaultSearch value. Default value is trueSavedSearchItem
instance, for chaining setter callspublic boolean getSaveDefaultSearch()
ListGrid.saveDefaultSearch
.
The default is stored in browser localStorage
using the savedSearchId
of the targetComponent
, or a combination of the
local or global ID
and DataSource ID if no savedSearchId was
specified (see documentation for savedSearchId
for details). If no targetComponent is specified, the savedSearchId or minimal locator of the
SavedSearchItem
itself 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.
public SavedSearchItem setSavedSearchDS(java.lang.String savedSearchDS)
SavedSearches.defaultDataSource
for this SavedSearchItem.savedSearchDS
- New savedSearchDS value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getSavedSearchDS()
SavedSearches.defaultDataSource
for this SavedSearchItem.public SavedSearchItem setSavedSearchId(java.lang.String savedSearchId)
saveDefaultSearch
for details.
Note : This is an advanced setting
savedSearchId
- New savedSearchId value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.String getSavedSearchId()
saveDefaultSearch
for details.public SavedSearchItem setSaveLastSearch(boolean saveLastSearch)
localStorage
, and will be applied
to the targetComponent
as soon as saved searches are loaded.saveLastSearch
- New saveLastSearch value. Default value is falseSavedSearchItem
instance, for chaining setter callspublic boolean getSaveLastSearch()
localStorage
, and will be applied
to the targetComponent
as soon as saved searches are loaded.public SavedSearchItem setStoredState(SavedSearchStoredState storedState)
storedState
- New storedState value. Default value is nullSavedSearchItem
instance, for chaining setter callsSavedSearchItem
public SavedSearchStoredState getStoredState()
SavedSearchItem
public SavedSearchItem setTargetComponent(DataBoundComponent targetComponent)
searchChanged()
fires, the search is
automatically applied to the targetComponent
unless the searchChanged
event is cancelled.
To avoid leaking local storage, saving searches will not be allowed for the target grid unless it specifies savedSearchId
, or an explicit local or global ID
is present.
If this method is called after the component has been drawn/initialized:
Changes the targetComponent
to the passed in newTargetComponent.
targetComponent
- the newTargetComponent. Default value is nullSavedSearchItem
instance, for chaining setter callspublic DataBoundComponent getTargetComponent()
searchChanged()
fires, the search is
automatically applied to the targetComponent
unless the searchChanged
event is cancelled.
To avoid leaking local storage, saving searches will not be allowed for the target grid unless it specifies savedSearchId
, or an explicit local or global ID
is present.
public SavedSearchItem setTargetDataSource(DataSource targetDataSource)
Normally auto-derived from targetComponent.dataSource
, but can be
specified manually if no targetComponent
is provided. In this case, searchChanged()
would be implement to apply
criteria in a custom way.
targetDataSource
- New targetDataSource value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic DataSource getTargetDataSource()
Normally auto-derived from targetComponent.dataSource
, but can be
specified manually if no targetComponent
is provided. In this case, searchChanged()
would be implement to apply
criteria in a custom way.
public SavedSearchItem setTargetEditsCriteria(java.lang.Boolean targetEditsCriteria)
targetComponent
has
built-in criteria editing or does not. True by default if the target is a ListGrid
or TreeGrid
(but not CubeGrid
). When the target has built-in criteria editing, the
SavedSearchItem
does not try to provide a FilterBuilder
-based
criteria editing interface, so the SavedSearchEditor
is simplified to just allow
naming of searches.
targetEditsCriteria
- New targetEditsCriteria value. Default value is nullSavedSearchItem
instance, for chaining setter callspublic java.lang.Boolean getTargetEditsCriteria()
targetComponent
has
built-in criteria editing or does not. True by default if the target is a ListGrid
or TreeGrid
(but not CubeGrid
). When the target has built-in criteria editing, the
SavedSearchItem
does not try to provide a FilterBuilder
-based
criteria editing interface, so the SavedSearchEditor
is simplified to just allow
naming of searches.
public SavedSearchItem setTitle(java.lang.String title)
setTitle
in class FormItem
title
- New title value. Default value is "Views"SavedSearchItem
instance, for chaining setter callsHTMLString
public java.lang.String getTitle()
getTitle
in class FormItem
HTMLString
public boolean searchChanged(Criteria newCriteria, Record searchData)
If a targetComponent
has
been specified, searchChanged
automatically applies the new search to the targetComponent
unless the event is cancelled .
newCriteria
- new criteriasearchData
- savedSearch recordtargetComponent
public static void setDefaultProperties(SavedSearchItem savedSearchItemProperties)
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.
savedSearchItemProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties