|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.layout.Layout
com.smartgwt.client.widgets.grid.ColumnTree
public class ColumnTree
The Smart GWT system supports hierarchical data (also referred to as tree data due to its "branching" organization) with:
Tree
class, which manipulates hierarchical data sets
TreeDataBinding
. A ColumnTree shows a single branch of
the underlying Tree
horizontally, from left to right. Thus, the leftmost
column shows all the top-level nodes. When the user clicks one of those nodes, a new column is shown immediately to the
right of the top-level column, showing the selected node's children. Additional columns are shown as required to present
lower-level children. The behavior of ColumnTree is similar to that of the Browser interface in the Apple™
iTunes™ application.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet, scClassName |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ColumnTree()
|
|
ColumnTree(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addFormulaField()
Convenience method to display a com.smartgwt.client..FormulaBuilder to create a new Formula Field. |
HandlerRegistration |
addNodeSelectedHandler(NodeSelectedHandler handler)
Add a onNodeSelected handler. |
void |
addSummaryField()
Convenience method to display a com.smartgwt.client..SummaryBuilder to create a new Summary Field. |
Boolean |
anySelected()
Whether at least one item is selected |
Boolean |
anySelected(int colNum)
Whether at least one item is selected in the supplied column (the first column if none is passed) |
protected JavaScriptObject |
create()
|
void |
deselectAllRecords()
Deselect all records |
void |
deselectAllRecords(int colNum)
Deselect all records in the supplied column (the first column if none is passed) |
void |
deselectRecord(int record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecord(int record,
int colNum)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecord(Record record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecord(Record[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecord(Record record,
int colNum)
|
void |
deselectRecords(int[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecords(int[] records,
int colNum)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecords(Record[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecords(Record[] records,
int colNum)
Deselect a list of Record s passed in explicitly, or by index. |
void |
disableHilite(String hiliteID)
Disable a hilite |
void |
disableHiliting()
Disable all hilites. |
void |
enableHilite(String hiliteID)
Enable / disable a hilites
|
void |
enableHilite(String hiliteID,
boolean enable)
Enable / disable a hilites
|
void |
enableHiliting()
Enable all hilites. |
void |
enableHiliting(boolean enable)
Enable all hilites. |
void |
fetchData()
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria,
DSCallback callback)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
filterData()
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
void |
filterData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Retrieves data that matches the provided criteria and displays the matching data in this component. |
Boolean |
getAddDropValues()
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
String |
getAddFormulaFieldText()
Text for a menu item allowing users to add a formula field |
String |
getAddOperation()
Operation ID this component should use when performing add operations. |
String |
getAddSummaryFieldText()
Text for a menu item allowing users to add a formula field |
Boolean |
getAutoFetchAsFilter()
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
Boolean |
getAutoFetchData()
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
TextMatchStyle |
getAutoFetchTextMatchStyle()
If autoFetchData is true , this
attribute allows the developer to specify a textMatchStyle for the initial fetchData() call. |
Boolean |
getCanAddFormulaFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
Boolean |
getCanAddSummaryFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
String |
getClosedIconSuffix()
This suffix will be appended to the folderIcon for
closed folders. |
void |
getColumnTitle(TreeNode node,
int colNum)
Returns the title to show for the header of indicated column. |
String |
getCustomIconOpenProperty()
This property allows the developer to rename the 'default node.showOpenIcon' property. |
String |
getCustomIconProperty()
This property allows the developer to customize the icon displayed next to a node. |
Tree |
getData()
A Tree object consisting of nested TreeNode s to display in this ColumnTree. |
FetchMode |
getDataFetchMode()
How to fetch and manage records retrieve from the server. |
int |
getDataPageSize()
When using data paging, how many records to fetch at a time. |
DataSource |
getDataSource()
The DataSource that this component should bind to for default fields and for performing DSRequest .
|
Record[] |
getDragData()
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. |
DragDataAction |
getDragDataAction()
Indicates what to do with data dragged into another DataBoundComponent. |
String |
getDragTrackerStyle()
CSS Style to apply to the drag tracker when dragging occurs on this component. |
String |
getDropIconSuffix()
If showDropIcons is true, this suffix will be
appended to the folderIcon when the user
drop-hovers over some folder. |
Map |
getDropValues()
When an item is dropped on this component, and addDropValues is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
|
String |
getDuplicateDragMessage()
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled. |
String |
getEditFormulaFieldText()
Text for a menu item allowing users to edit a formula field |
String |
getEditSummaryFieldText()
Text for a menu item allowing users to edit the formatter for a field |
Boolean |
getExportAll()
Setting exportAll to true prevents the component from passing it's list of fields to the export call. |
String[] |
getExportFields()
The list of field-names to export. |
String |
getFetchOperation()
Operation ID this component should use when performing fetch operations. |
String |
getFirstColumnTitle()
A title for the leftmost column if showHeaders is set
(the remaining columns have their titles derived from the item selected in the column to the left). |
String |
getFolderIcon()
The URL of the base icon for all folder nodes in this columnTree. |
String |
getHiliteProperty()
Marker that can be set on a record to flag that record as hilited. |
String |
getIcon(TreeNode node)
Get the appropriate icon for a node. |
Criteria |
getInitialCriteria()
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
Boolean |
getLoadDataOnDemand()
For databound columnTree instances, should the entire tree of data be loaded on initial fetch, or should each coluimn be loaded as needed. |
String |
getNodeIcon()
The filename of the default icon for all leaf nodes in this grid. |
String |
getOpenIconSuffix()
If showOpenIcons is true, this suffix will be
appended to the folderIcon for open folders in this
grid. |
static ColumnTree |
getOrCreateRef(JavaScriptObject jsObj)
|
Boolean |
getPreventDuplicates()
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
TreeNode |
getRecord(int index)
Retrieve a record by index. |
TreeNode |
getRecord(int index,
int colNum)
Retrieve a record by index. |
int |
getRecordIndex(Record record)
Get the index of the provided record. |
RecordList |
getRecordList()
Return the underlying data of this DataBoundComponent as a RecordList . |
String |
getRemoveOperation()
Operation ID this component should use when performing remove operations. |
ResultSet |
getResultSet()
Return the underlying data of this DataBoundComponent as a ResultSet . |
ListGridRecord[] |
getSelection(int colNum)
Returns the array of objects selected in the specified column of the columnTree |
Boolean |
getShowComplexFields()
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
Boolean |
getShowCustomIconOpen()
Should folder nodes showing custom icons (set via the customIconProperty ), show open state images when the
folder is opened. |
Boolean |
getShowDetailFields()
Whether to show fields marked detail:true when a DataBoundComponent is
given a DataSource but no component.fields .
|
Boolean |
getShowDropIcons()
If true, when the user drags a droppable target over a folder in this TreeGrid, show a different icon folder icon. |
Boolean |
getShowHeaders()
If set, each column in the ColumnTree will show a header with the title of the selected node from the column to the left. |
Boolean |
getShowHiddenFields()
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
Boolean |
getShowNodeCount()
If set, and showHeaders is also set, each column's
header will show a count of the number of nodes in that column |
Boolean |
getShowOpenIcons()
If true, show a different icon for open folders than closed folders. |
String |
getTitleField()
Method to return the fieldName which represents the "title" for records in this Component. If this.titleField is explicitly specified it will always be used. Otherwise, default implementation will check titleField for databound
compounds.For non databound components returns the first defined field name of "title" ,
"name" , or "id" . |
String |
getTitleFieldValue(Record record)
Get the value of the titleField for the passed record |
String |
getUpdateOperation()
Operation ID this component should use when performing update operations. |
Boolean |
getUseAllDataSourceFields()
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
Boolean |
getUseFlatFields()
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
void |
invalidateCache()
Invalidate the current data cache for this databound component via a call to this.data.invalidateCache() . |
void |
selectAllRecords()
Select all records |
void |
selectAllRecords(int colNum)
Select all records in the supplied column (the first column if none is passed) |
void |
selectRecord(int record)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(int record,
boolean newState)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(int record,
boolean newState,
int colNum)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(Record record)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(Record record,
boolean newState)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecord(Record record,
boolean newState,
int colNum)
Select/deselect a Record passed in explicitly, or by index. |
void |
selectRecords(int[] records)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState,
int colNum)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState,
int colNum)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
setAddDropValues(Boolean addDropValues)
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
void |
setAddFormulaFieldText(String addFormulaFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAddOperation(String addOperation)
Operation ID this component should use when performing add operations. |
void |
setAddSummaryFieldText(String addSummaryFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAutoFetchAsFilter(Boolean autoFetchAsFilter)
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
void |
setAutoFetchData(Boolean autoFetchData)
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
void |
setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
If autoFetchData is true , this
attribute allows the developer to specify a textMatchStyle for the initial fetchData() call. |
void |
setCanAddFormulaFields(Boolean canAddFormulaFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
void |
setCanAddSummaryFields(Boolean canAddSummaryFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
void |
setClosedIconSuffix(String closedIconSuffix)
This suffix will be appended to the folderIcon for
closed folders. |
void |
setCustomIconOpenProperty(String customIconOpenProperty)
This property allows the developer to rename the 'default node.showOpenIcon' property. |
void |
setCustomIconProperty(String customIconProperty)
This property allows the developer to customize the icon displayed next to a node. |
void |
setData(Tree data)
A Tree object consisting of nested TreeNode s to display in this ColumnTree. |
void |
setDataFetchMode(FetchMode fetchMode)
How to fetch and manage records retrieve from the server. |
void |
setDataPageSize(int dataPageSize)
When using data paging, how many records to fetch at a time. |
void |
setDataSource(DataSource dataSource)
The DataSource that this component should bind to for default fields and for performing DSRequest .
|
void |
setDragDataAction(DragDataAction dragDataAction)
Indicates what to do with data dragged into another DataBoundComponent. |
void |
setDragTrackerStyle(String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component. |
void |
setDropIconSuffix(String dropIconSuffix)
If showDropIcons is true, this suffix will be
appended to the folderIcon when the user
drop-hovers over some folder. |
void |
setDropValues(Map dropValues)
When an item is dropped on this component, and addDropValues is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
|
void |
setDuplicateDragMessage(String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled. |
void |
setEditFormulaFieldText(String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field |
void |
setEditSummaryFieldText(String editSummaryFieldText)
Text for a menu item allowing users to edit the formatter for a field |
void |
setExportAll(Boolean exportAll)
Setting exportAll to true prevents the component from passing it's list of fields to the export call. |
void |
setExportFields(String[] exportFields)
The list of field-names to export. |
void |
setFetchOperation(String fetchOperation)
Operation ID this component should use when performing fetch operations. |
void |
setFields(ListGridField... fields)
|
void |
setFirstColumnTitle(String firstColumnTitle)
A title for the leftmost column if showHeaders is set
(the remaining columns have their titles derived from the item selected in the column to the left). |
void |
setFolderIcon(String folderIcon)
The URL of the base icon for all folder nodes in this columnTree. |
void |
setHiliteProperty(String hiliteProperty)
Marker that can be set on a record to flag that record as hilited. |
void |
setInitialCriteria(Criteria initialCriteria)
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
void |
setLoadDataOnDemand(Boolean loadDataOnDemand)
For databound columnTree instances, should the entire tree of data be loaded on initial fetch, or should each coluimn be loaded as needed. |
void |
setNodeIcon(String nodeIcon)
The filename of the default icon for all leaf nodes in this grid. |
void |
setOpenIconSuffix(String openIconSuffix)
If showOpenIcons is true, this suffix will be
appended to the folderIcon for open folders in this
grid. |
void |
setPreventDuplicates(Boolean preventDuplicates)
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
void |
setRemoveOperation(String removeOperation)
Operation ID this component should use when performing remove operations. |
void |
setShowComplexFields(Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
void |
setShowCustomIconOpen(Boolean showCustomIconOpen)
Should folder nodes showing custom icons (set via the customIconProperty ), show open state images when the
folder is opened. |
void |
setShowDetailFields(Boolean showDetailFields)
Whether to show fields marked detail:true when a DataBoundComponent is
given a DataSource but no component.fields .
|
void |
setShowDropIcons(Boolean showDropIcons)
If true, when the user drags a droppable target over a folder in this TreeGrid, show a different icon folder icon. |
void |
setShowHeaders(Boolean showHeaders)
If set, each column in the ColumnTree will show a header with the title of the selected node from the column to the left. |
void |
setShowHiddenFields(Boolean showHiddenFields)
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
void |
setShowNodeCount(Boolean showNodeCount)
If set, and showHeaders is also set, each column's
header will show a count of the number of nodes in that column |
void |
setShowOpenIcons(Boolean showOpenIcons)
If true, show a different icon for open folders than closed folders. |
void |
setTitleField(String titleField)
|
void |
setUpdateOperation(String updateOperation)
Operation ID this component should use when performing update operations. |
void |
setUseAllDataSourceFields(Boolean useAllDataSourceFields)
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
void |
setUseFlatFields(Boolean useFlatFields)
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
void |
shouldShowHeader(TreeNode node,
int colNum)
Whether the indicated column should show a header. |
void |
transferSelectedData(DataBoundComponent source)
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. |
void |
transferSelectedData(DataBoundComponent source,
int index)
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent |
---|
getOrCreateJsObj |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public ColumnTree()
public ColumnTree(JavaScriptObject jsObj)
Method Detail |
---|
public static ColumnTree getOrCreateRef(JavaScriptObject jsObj)
protected JavaScriptObject create()
create
in class Layout
public void setData(Tree data)
Tree
object consisting of nested TreeNode
s to display in this ColumnTree. The data
property will
typically not be explicitly specified for databound ColumnTrees, where the data is returned from the server via
databound component methods such as fetchData()
Set the Tree
object this ColumnTree will view
data
- Tree to show. Default value is nullpublic Tree getData()
Tree
object consisting of nested TreeNode
s to display in this ColumnTree. The data
property will
typically not be explicitly specified for databound ColumnTrees, where the data is returned from the server via
databound component methods such as fetchData()
Tree
object this ColumnTree is viewingpublic void setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws IllegalStateException
autoFetchData
is true
, this
attribute allows the developer to specify a textMatchStyle for the initial fetchData()
call.
autoFetchTextMatchStyle
- autoFetchTextMatchStyle Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic TextMatchStyle getAutoFetchTextMatchStyle()
autoFetchData
is true
, this
attribute allows the developer to specify a textMatchStyle for the initial fetchData()
call.
public void setFolderIcon(String folderIcon)
openIconSuffix
or closedIconSuffix
appended to indicate state changes if
appropriate - see documentation on showOpenIcons
folderIcon
- folderIcon Default value is "[SKIN]folder.gif"public String getFolderIcon()
openIconSuffix
or closedIconSuffix
appended to indicate state changes if
appropriate - see documentation on showOpenIcons
public void setCustomIconProperty(String customIconProperty)
node[grid.customIconProperty]
to the URL of the desired icon to display and it will be shown instead of the
standard nodeIcon
for this node.showCustomIconOpen
is true for this grid, customized
icons for folder nodes will be appended with the openIconSuffix
suffix on state change, as with the standard folderIcon
. Also note that for custom folder icons, the
closedIconSuffix
will never be appened.
customIconProperty
- customIconProperty Default value is "icon"public String getCustomIconProperty()
node[grid.customIconProperty]
to the URL of the desired icon to display and it will be shown instead of the
standard nodeIcon
for this node.showCustomIconOpen
is true for this grid, customized
icons for folder nodes will be appended with the openIconSuffix
suffix on state change, as with the standard folderIcon
. Also note that for custom folder icons, the
closedIconSuffix
will never be appened.
public void setNodeIcon(String nodeIcon)
customIconProperty
directly on the node.
nodeIcon
- nodeIcon Default value is "[SKIN]file.gif"public String getNodeIcon()
customIconProperty
directly on the node.
public void setOpenIconSuffix(String openIconSuffix)
showOpenIcons
is true, this suffix will be
appended to the folderIcon
for open folders in this
grid.
openIconSuffix
- openIconSuffix Default value is "open"public String getOpenIconSuffix()
showOpenIcons
is true, this suffix will be
appended to the folderIcon
for open folders in this
grid.
public void setClosedIconSuffix(String closedIconSuffix)
folderIcon
for
closed folders. If showOpenIcons
is set to
false
this suffix will also be appended to open folders' icons.
closedIconSuffix
- closedIconSuffix Default value is "closed"public String getClosedIconSuffix()
folderIcon
for
closed folders. If showOpenIcons
is set to
false
this suffix will also be appended to open folders' icons.
public void setShowOpenIcons(Boolean showOpenIcons)
open
folders than closed folders. This is achieved by appending the
openIconSuffix
onto the folderIcon
URL [for example "[SKIN]/folder.gif"
might be replaced by "[SKIN]/folder_open.gif"
.false
the same icon is shown for open folders as for closed folders, unless a custom folder icon was
specified. This will be determined by folderIcon
plus
the closedIconSuffix
.
showOpenIcons
- showOpenIcons Default value is truepublic Boolean getShowOpenIcons()
open
folders than closed folders. This is achieved by appending the
openIconSuffix
onto the folderIcon
URL [for example "[SKIN]/folder.gif"
might be replaced by "[SKIN]/folder_open.gif"
.false
the same icon is shown for open folders as for closed folders, unless a custom folder icon was
specified. This will be determined by folderIcon
plus
the closedIconSuffix
.
public void setShowCustomIconOpen(Boolean showCustomIconOpen)
customIconProperty
), show open state images when the
folder is opened. If true, the openIconSuffix
will
be appended to the image URL (so "customFolder.gif"
might be replaced with
"customFolder_open.gif"
).closedIconSuffix
is never appended to custom folder
icons.showOpenIcon
and that property can be renamed via customIconOpenProperty
.
Note : This is an advanced setting
showCustomIconOpen
- showCustomIconOpen Default value is falsepublic Boolean getShowCustomIconOpen()
customIconProperty
), show open state images when the
folder is opened. If true, the openIconSuffix
will
be appended to the image URL (so "customFolder.gif"
might be replaced with
"customFolder_open.gif"
).closedIconSuffix
is never appended to custom folder
icons.showOpenIcon
and that property can be renamed via customIconOpenProperty
.
public void setCustomIconOpenProperty(String customIconOpenProperty)
'default node.showOpenIcon'
property.
Note : This is an advanced setting
customIconOpenProperty
- customIconOpenProperty Default value is "showOpenIcon"public String getCustomIconOpenProperty()
'default node.showOpenIcon'
property.
public void setLoadDataOnDemand(Boolean loadDataOnDemand) throws IllegalStateException
loadDataOnDemand
- loadDataOnDemand Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getLoadDataOnDemand()
public void setShowHeaders(Boolean showHeaders) throws IllegalStateException
showHeaders
- showHeaders Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowHeaders()
public void setFirstColumnTitle(String firstColumnTitle) throws IllegalStateException
showHeaders
is set
(the remaining columns have their titles derived from the item selected in the column to the left). Ignored if showHeaders
is not set.
firstColumnTitle
- firstColumnTitle Default value is " "
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getFirstColumnTitle()
showHeaders
is set
(the remaining columns have their titles derived from the item selected in the column to the left). Ignored if showHeaders
is not set.
public void setShowNodeCount(Boolean showNodeCount) throws IllegalStateException
showHeaders
is also set, each column's
header will show a count of the number of nodes in that column
showNodeCount
- showNodeCount Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowNodeCount()
showHeaders
is also set, each column's
header will show a count of the number of nodes in that column
public void shouldShowHeader(TreeNode node, int colNum)
node
- parent node for the nodes to be shown in the columncolNum
- index of the columnpublic void getColumnTitle(TreeNode node, int colNum)
shouldShowHeader(com.smartgwt.client.widgets.tree.TreeNode, int)
returns true for this column. By default, returns
firstColumnTitle
for the first column, and for
subsequent columns, the result of Tree.getTitle(com.smartgwt.client.widgets.tree.TreeNode)
called on the node
passed to this function.
node
- parent node for the nodes to be shown in the columncolNum
- index of the columnpublic TreeNode getRecord(int index)
If colNum
is passed, returns the record found in that column at that
index, or null if the column doesn't exist or the index is too high.
With no colNum
parameter, a
record's index is it's position counting from the first record of the first column and including all records in each
column. Note that both index and colNum are zero-based - so the first column is column 0, not column 1.
index
- index of record to return.
public TreeNode getRecord(int index, int colNum)
If colNum
is passed, returns the record found in that column at that
index, or null if the column doesn't exist or the index is too high.
With no colNum
parameter, a
record's index is it's position counting from the first record of the first column and including all records in each
column. Note that both index and colNum are zero-based - so the first column is column 0, not column 1.
index
- index of record to return.colNum
- optional index of the column
public String getIcon(TreeNode node)
By default icons are derived from folderIcon
and nodeIcon
. Custom icons for individual nodes can be overriden by
setting the customIconProperty
on a node.
If you want to suppress icons altogether, provide an override of this method that simply returns null.
Note that
the full icon URL will be derived by applying Canvas.getImgURL(java.lang.String)
to the value returned
from this method.
node
- tree node in question
public void setFields(ListGridField... fields)
public void setDropIconSuffix(String dropIconSuffix)
showDropIcons
is true, this suffix will be
appended to the folderIcon
when the user
drop-hovers over some folder.
dropIconSuffix
- dropIconSuffix Default value is "drop"public String getDropIconSuffix()
showDropIcons
is true, this suffix will be
appended to the folderIcon
when the user
drop-hovers over some folder.
public void setShowDropIcons(Boolean showDropIcons)
dropIconSuffix
onto the folderIcon
URL (for
example "[SKIN]/folder.gif"
may be replaced by "[SKIN]/folder_drop.gif"
).
showDropIcons
- showDropIcons Default value is truepublic Boolean getShowDropIcons()
dropIconSuffix
onto the folderIcon
URL (for
example "[SKIN]/folder.gif"
may be replaced by "[SKIN]/folder_drop.gif"
).
public void deselectRecord(Record record, int colNum)
public void deselectRecord(int record, int colNum)
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
record
- row number to deselectcolNum
- the column numberpublic void deselectRecords(int[] records, int colNum)
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
records
- records (or row numbers) to deselectcolNum
- the col numpublic void deselectRecord(Record[] records)
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
records
- records (or row numbers) to deselectpublic void deselectRecords(Record[] records, int colNum)
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
records
- records (or row numbers) to deselectcolNum
- the col numpublic void selectRecord(int record, boolean newState, int colNum)
Record
passed in explicitly, or by index.
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)colNum
- Column numberpublic void selectRecord(Record record, boolean newState, int colNum)
Record
passed in explicitly, or by index.
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)colNum
- Column numberpublic void selectRecords(int[] records, boolean newState, int colNum)
Record
s passed in explicitly, or by index.
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)colNum
- Column numberpublic void selectRecords(Record[] records, boolean newState, int colNum)
Record
s passed in explicitly, or by index.
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)colNum
- Column numberpublic ListGridRecord[] getSelection(int colNum)
colNum
- Column within the columnTree to return the selection for
public void selectAllRecords(int colNum)
colNum
- Column numberpublic void deselectAllRecords(int colNum)
colNum
- Column numberpublic Boolean anySelected(int colNum)
colNum
- Column number
public HandlerRegistration addNodeSelectedHandler(NodeSelectedHandler handler)
addNodeSelectedHandler
in interface HasNodeSelectedHandlers
handler
- the onNodeSelected handler
HandlerRegistration
used to remove this handlerpublic void setDataFetchMode(FetchMode fetchMode)
DataBoundComponent
FetchMode
.
This setting only applies to the ResultSet
automatically created by calling fetchData
.
If a pre-existing ResultSet is passed to setData() instead, it's existing setting for fetchMode
applies.
setDataFetchMode
in interface DataBoundComponent
fetchMode
- the fetch modepublic FetchMode getDataFetchMode()
DataBoundComponent
FetchMode
.
This setting only applies to the ResultSet
automatically created by calling fetchData
.
If a pre-existing ResultSet is passed to setData() instead, it's existing setting for fetchMode
applies.
getDataFetchMode
in interface DataBoundComponent
public void setDataPageSize(int dataPageSize)
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
setDataPageSize
in interface DataBoundComponent
dataPageSize
- dataPageSize Default value is 75public int getDataPageSize()
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
getDataPageSize
in interface DataBoundComponent
public void setUseAllDataSourceFields(Boolean useAllDataSourceFields)
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
${isc.DocUtils.linkForExampleId('validationFieldBinding', 'This example')} shows a mixture of component fields and DataSource fields, and how they interact for validation.
setUseAllDataSourceFields
in interface DataBoundComponent
useAllDataSourceFields
- useAllDataSourceFields Default value is falsepublic Boolean getUseAllDataSourceFields()
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
${isc.DocUtils.linkForExampleId('validationFieldBinding', 'This example')} shows a mixture of component fields and DataSource fields, and how they interact for validation.
getUseAllDataSourceFields
in interface DataBoundComponent
public void setShowHiddenFields(Boolean showHiddenFields)
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
setShowHiddenFields
in interface DataBoundComponent
showHiddenFields
- showHiddenFields Default value is falsepublic Boolean getShowHiddenFields()
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
getShowHiddenFields
in interface DataBoundComponent
public void setShowDetailFields(Boolean showDetailFields)
DataBoundComponent
detail:true
when a DataBoundComponent is
given a DataSource but no component.fields
.
The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- showDetailFields Default value is falsepublic Boolean getShowDetailFields()
DataBoundComponent
detail:true
when a DataBoundComponent is
given a DataSource but no component.fields
.
The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
getShowDetailFields
in interface DataBoundComponent
public void setShowComplexFields(Boolean showComplexFields)
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
Note : This is an advanced setting
setShowComplexFields
in interface DataBoundComponent
showComplexFields
- showComplexFields Default value is truepublic Boolean getShowComplexFields()
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
getShowComplexFields
in interface DataBoundComponent
public void setFetchOperation(String fetchOperation)
DataBoundComponent
setFetchOperation
in interface DataBoundComponent
fetchOperation
- fetchOperation Default value is nullpublic String getFetchOperation()
DataBoundComponent
getFetchOperation
in interface DataBoundComponent
public void setUpdateOperation(String updateOperation)
DataBoundComponent
setUpdateOperation
in interface DataBoundComponent
updateOperation
- updateOperation Default value is nullpublic String getUpdateOperation()
DataBoundComponent
getUpdateOperation
in interface DataBoundComponent
public void setAddOperation(String addOperation)
DataBoundComponent
setAddOperation
in interface DataBoundComponent
addOperation
- addOperation Default value is nullpublic String getAddOperation()
DataBoundComponent
getAddOperation
in interface DataBoundComponent
public void setRemoveOperation(String removeOperation)
DataBoundComponent
setRemoveOperation
in interface DataBoundComponent
removeOperation
- removeOperation Default value is nullpublic String getRemoveOperation()
DataBoundComponent
getRemoveOperation
in interface DataBoundComponent
public void setExportFields(String[] exportFields)
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
setExportFields
in interface DataBoundComponent
exportFields
- exportFields Default value is nullpublic String[] getExportFields()
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
getExportFields
in interface DataBoundComponent
public void setExportAll(Boolean exportAll)
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
setExportAll
in interface DataBoundComponent
exportAll
- exportAll Default value is falsepublic Boolean getExportAll()
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
getExportAll
in interface DataBoundComponent
public void setPreventDuplicates(Boolean preventDuplicates) throws IllegalStateException
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
setPreventDuplicates
in interface DataBoundComponent
preventDuplicates
- preventDuplicates Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getPreventDuplicates()
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
getPreventDuplicates
in interface DataBoundComponent
public void setDuplicateDragMessage(String duplicateDragMessage) throws IllegalStateException
DataBoundComponent
preventDuplicates
is enabled.
setDuplicateDragMessage
in interface DataBoundComponent
duplicateDragMessage
- duplicateDragMessage Default value is "Duplicates not allowed"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getDuplicateDragMessage()
DataBoundComponent
preventDuplicates
is enabled.
getDuplicateDragMessage
in interface DataBoundComponent
public void setAddDropValues(Boolean addDropValues)
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will
be called for every databound item dropped on this grid, and an update performed
on the item
setAddDropValues
in interface DataBoundComponent
addDropValues
- addDropValues Default value is truepublic Boolean getAddDropValues()
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will
be called for every databound item dropped on this grid, and an update performed
on the item
getAddDropValues
in interface DataBoundComponent
public void setDropValues(Map dropValues)
DataBoundComponent
addDropValues
is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
If this property is not defined, SmartGWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
setDropValues
in interface DataBoundComponent
dropValues
- dropValues Default value is nullpublic Map getDropValues()
DataBoundComponent
addDropValues
is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
If this property is not defined, SmartGWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
getDropValues
in interface DataBoundComponent
dropValues
for more details. If multiple records
are being dropped, this method is called for each of them in turn.
This method returns the following:
addDropValues
is falseYou can override this method if you need more complex setting of drop values than can be provided by simply supplying a dropValues object.
public void setUseFlatFields(Boolean useFlatFields) throws IllegalStateException
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of DynamicForm.getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
setUseFlatFields
in interface DataBoundComponent
useFlatFields
- useFlatFields Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getUseFlatFields()
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of DynamicForm.getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
getUseFlatFields
in interface DataBoundComponent
public void setHiliteProperty(String hiliteProperty)
DataBoundComponent
id
for a hilite defined on this component.
setHiliteProperty
in interface DataBoundComponent
hiliteProperty
- hiliteProperty Default value is "_hilite"public String getHiliteProperty()
DataBoundComponent
id
for a hilite defined on this component.
getHiliteProperty
in interface DataBoundComponent
public void setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction
in interface DataBoundComponent
dragDataAction
- dragDataAction Default value is Canvas.MOVEpublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction
in interface DataBoundComponent
public void setDragTrackerStyle(String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle
in interface DataBoundComponent
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"public String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle
in interface DataBoundComponent
public void setCanAddFormulaFields(Boolean canAddFormulaFields)
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddFormulaFields
in interface DataBoundComponent
canAddFormulaFields
- canAddFormulaFields Default value is falsepublic void addSummaryField()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
to create a new Summary Field. This
is equivalent to calling DataBoundComponentGen#editSummaryField
with
no paramater.
addSummaryField
in interface DataBoundComponent
public void addFormulaField()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
to create a new Formula Field. This
is equivalent to calling DataBoundComponentGen#editFormulaField
with
no paramater.
addFormulaField
in interface DataBoundComponent
public Boolean getCanAddFormulaFields()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddFormulaFields
in interface DataBoundComponent
public void setAddFormulaFieldText(String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText
in interface DataBoundComponent
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."public String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText
in interface DataBoundComponent
public void setEditFormulaFieldText(String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText
in interface DataBoundComponent
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."public String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText
in interface DataBoundComponent
public void setCanAddSummaryFields(Boolean canAddSummaryFields)
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddSummaryFields
in interface DataBoundComponent
canAddSummaryFields
- canAddSummaryFields Default value is falsepublic Boolean getCanAddSummaryFields()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddSummaryFields
in interface DataBoundComponent
public void setAddSummaryFieldText(String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText
in interface DataBoundComponent
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."public String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText
in interface DataBoundComponent
public void setEditSummaryFieldText(String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText
in interface DataBoundComponent
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."public String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText
in interface DataBoundComponent
public void selectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecord(Record record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(int[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection statepublic void selectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(Record[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)public void deselectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void deselectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void selectAllRecords()
DataBoundComponent
selectAllRecords
in interface DataBoundComponent
public void deselectAllRecords()
DataBoundComponent
deselectAllRecords
in interface DataBoundComponent
public Boolean anySelected()
DataBoundComponent
anySelected
in interface DataBoundComponent
public void enableHilite(String hiliteID)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enablepublic void enableHilite(String hiliteID, boolean enable)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enableenable
- new enabled state to apply - if null, defaults to truepublic void disableHilite(String hiliteID)
DataBoundComponent
disableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to disablepublic void enableHiliting()
DataBoundComponent
enableHiliting
in interface DataBoundComponent
public void enableHiliting(boolean enable)
DataBoundComponent
enableHiliting
in interface DataBoundComponent
enable
- new enabled state to apply - if null, defaults to truepublic void disableHiliting()
DataBoundComponent
disableHiliting
in interface DataBoundComponent
public Record[] getDragData()
DataBoundComponent
This method is generally called by com.smartgwt.client.widgets.DataBoundComponent#transferDragData
and is consulted by
ListGrid.willAcceptDrop()
.
getDragData
in interface DataBoundComponent
Record
s that are currently selected.public void transferSelectedData(DataBoundComponent source)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
See the Dragging
documentation for an overview of list grid drag/drop data
transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredpublic void transferSelectedData(DataBoundComponent source, int index)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
See the Dragging
documentation for an overview of list grid drag/drop data
transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredindex
- target index (drop position) of the rows within this grid.public int getRecordIndex(Record record)
DataBoundComponent
Override in subclasses to provide more specific behaviour, for instance, when data holds a large number of records
getRecordIndex
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public String getTitleFieldValue(Record record)
DataBoundComponent
Override in subclasses
getTitleFieldValue
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public void setTitleField(String titleField)
setTitleField
in interface DataBoundComponent
public String getTitleField()
DataBoundComponent
titleField
for databound
compounds."title"
,
"name"
, or "id"
. If we dont find any field-names that match these
titles, the first field in the component will be used instead.
getTitleField
in interface DataBoundComponent
public void setDataSource(DataSource dataSource)
DataBoundComponent
DSRequest
.
Can be specified as either a DataSource instance or the String ID of a DataSource. Bind to a new DataSource.
Like passing the "dataSource" property on creation, binding to a DataSource means that the component will use the DataSource to provide default data for its fields.
When binding to a new DataSource, if the component has any existing "fields" or has a dataset, these will be discarded by default, since it is assumed the new DataSource may represent a completely unrelated set of objects. If the old "fields" are still relevant, pass them to setDataSource().
setDataSource
in interface DataBoundComponent
dataSource
- DataSource to bind to. Default value is nullpublic DataSource getDataSource()
DataBoundComponent
DSRequest
.
Can be specified as either a DataSource instance or the String ID of a DataSource.
getDataSource
in interface DataBoundComponent
public void setAutoFetchData(Boolean autoFetchData) throws IllegalStateException
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
.
setAutoFetchData
in interface DataBoundComponent
autoFetchData
- autoFetchData
IllegalStateException
public Boolean getAutoFetchData()
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
.
getAutoFetchData
in interface DataBoundComponent
public void setAutoFetchAsFilter(Boolean autoFetchAsFilter) throws IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
setAutoFetchAsFilter
in interface DataBoundComponent
autoFetchAsFilter
- autoFetchAsFilter
IllegalStateException
public Boolean getAutoFetchAsFilter()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
getAutoFetchAsFilter
in interface DataBoundComponent
public void setInitialCriteria(Criteria initialCriteria) throws IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
setInitialCriteria
in interface DataBoundComponent
initialCriteria
- the initial criteria
IllegalStateException
- this property cannot be changed after the component has been createdpublic Criteria getInitialCriteria()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
getInitialCriteria
in interface DataBoundComponent
public void fetchData()
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call ResultSet.setCriteria(com.smartgwt.client.data.Criteria)
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
.
If you need to force a server
fetch, you can call ResultSet.invalidateCache()
via
component.data.invalidateCache()
to do so.
This method takes an optional callback parameter
(set to a DSCallback
) to fire when the fetch completes. Note that this
callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as
soon as this method completes you can interact with the new data. If necessary we recomment using ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use ResultSet.dataArrived(int, int)
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
public void fetchData(Criteria criteria)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call ResultSet.setCriteria(com.smartgwt.client.data.Criteria)
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
.
If you need to force a server
fetch, you can call ResultSet.invalidateCache()
via
component.data.invalidateCache()
to do so.
This method takes an optional callback parameter
(set to a DSCallback
) to fire when the fetch completes. Note that this
callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as
soon as this method completes you can interact with the new data. If necessary we recomment using ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use ResultSet.dataArrived(int, int)
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void fetchData(Criteria criteria, DSCallback callback)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call ResultSet.setCriteria(com.smartgwt.client.data.Criteria)
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
.
If you need to force a server
fetch, you can call ResultSet.invalidateCache()
via
component.data.invalidateCache()
to do so.
This method takes an optional callback parameter
(set to a DSCallback
) to fire when the fetch completes. Note that this
callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as
soon as this method completes you can interact with the new data. If necessary we recomment using ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use ResultSet.dataArrived(int, int)
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was requiredpublic void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call ResultSet.setCriteria(com.smartgwt.client.data.Criteria)
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
.
If you need to force a server
fetch, you can call ResultSet.invalidateCache()
via
component.data.invalidateCache()
to do so.
This method takes an optional callback parameter
(set to a DSCallback
) to fire when the fetch completes. Note that this
callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as
soon as this method completes you can interact with the new data. If necessary we recomment using ResultSet.willFetchData(com.smartgwt.client.data.Criteria)
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use ResultSet.dataArrived(int, int)
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was requiredrequestProperties
- additional properties to set on the DSRequest
that will be issuedpublic void filterData()
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
public void filterData(Criteria criteria)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling DynamicForm.getValuesAsCriteria()
public void filterData(Criteria criteria, DSCallback callback)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailspublic void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling DynamicForm.getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailsrequestProperties
- for databound components only - optional additional
properties to set on the DSRequest that will be issuedpublic void invalidateCache()
DataBoundComponent
this.data.invalidateCache()
. If necessary, this will cause a new fetch to
be performed with the current set of criteria for this component.
Has no effect if this component is not showing a set of filtered data.
invalidateCache
in interface DataBoundComponent
public ResultSet getResultSet() throws IllegalStateException
DataBoundComponent
ResultSet
.
Note that this method should only be called after initial data has been fetched by this DataBoundComponent.
getResultSet
in interface DataBoundComponent
IllegalStateException
- if called on a component with local array data, or a DataBoundComponent before the
initial data is fetched.DataBoundComponent.fetchData()
public RecordList getRecordList()
DataBoundComponent
RecordList
.
If the underlying data in not local data, and the component is bound to a DataSource
,
then the actual instance of the RecordList will be of type ResultSet
.
getRecordList
in interface DataBoundComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |