Class ColumnTree

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, DataBoundComponent, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragCompleteHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropCompleteHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFetchDataHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasNodeSelectedHandlers, HasMembersChangedHandlers

public class ColumnTree extends Layout implements HasNodeSelectedHandlers, DataBoundComponent
The Smart GWT system supports hierarchical data (also referred to as tree data due to its "branching" organization) with:
  • the Tree class, which manipulates hierarchical data sets
  • the TreeGrid widget class, which extends the ListGrid class to visually present tree data in an expandable/collapsible format.
  • the ColumnTree widget class, which visually presents tree data in a so-called "Miller Column" format.
For information on DataBinding Trees, see 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.

  • Constructor Details

    • ColumnTree

      public ColumnTree()
    • ColumnTree

      public ColumnTree(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static ColumnTree getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Layout
    • getBackButton

      public IButton getBackButton() throws IllegalStateException
      When using single-column mode, this is the "Back" button that you see hovering above the column UI and that allows backward navigation.

      This component is an AutoChild named "backButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current backButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setBackButtonTitle

      public ColumnTree setBackButtonTitle(String backButtonTitle)
      When using single-column mode, this i18n property dictates the title for the button docked to the top left which allows navigation back through the column tree.
      Parameters:
      backButtonTitle - New backButtonTitle value. Default value is "Back"
      Returns:
      ColumnTree instance, for chaining setter calls
    • getBackButtonTitle

      public String getBackButtonTitle()
      When using single-column mode, this i18n property dictates the title for the button docked to the top left which allows navigation back through the column tree.
      Returns:
      Current backButtonTitle value. Default value is "Back"
    • setCanDragRecordsOut

      public ColumnTree setCanDragRecordsOut(Boolean canDragRecordsOut)
      Indicates whether records can be dragged from this listGrid and dropped elsewhere.

      NOTE: If canDragRecordsOut is initially enabled or might be dynamically enabled after the grid is created, it may be desirable to disable touch scrolling so that touch-dragging a record starts a drag operation rather than a scroll, but see the discussion of drag handles. If Canvas.disableTouchScrollingForDrag is set to true, then touch scrolling will be disabled automatically. However, for accessibility reasons, it is recommended to leave touch scrolling enabled and provide an alternative set of controls that can be used to perform drag and drop of records out of the grid.

      Parameters:
      canDragRecordsOut - New canDragRecordsOut value. Default value is false
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getCanDragRecordsOut

      public Boolean getCanDragRecordsOut()
      Indicates whether records can be dragged from this listGrid and dropped elsewhere.

      NOTE: If canDragRecordsOut is initially enabled or might be dynamically enabled after the grid is created, it may be desirable to disable touch scrolling so that touch-dragging a record starts a drag operation rather than a scroll, but see the discussion of drag handles. If Canvas.disableTouchScrollingForDrag is set to true, then touch scrolling will be disabled automatically. However, for accessibility reasons, it is recommended to leave touch scrolling enabled and provide an alternative set of controls that can be used to perform drag and drop of records out of the grid.

      Returns:
      Current canDragRecordsOut value. Default value is false
      See Also:
    • setClosedIconSuffix

      public ColumnTree setClosedIconSuffix(String closedIconSuffix)
      This suffix will be appended to the folderIcon for closed folders. If showOpenIcons is set to false this suffix will also be appended to open folders' icons.
      Parameters:
      closedIconSuffix - New closedIconSuffix value. Default value is "closed"
      Returns:
      ColumnTree instance, for chaining setter calls
    • getClosedIconSuffix

      public String getClosedIconSuffix()
      This suffix will be appended to the folderIcon for closed folders. If showOpenIcons is set to false this suffix will also be appended to open folders' icons.
      Returns:
      Current closedIconSuffix value. Default value is "closed"
    • getColumn

      public ListGrid getColumn()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      Instance of ListGrid used to display each column of the tree.

      Returns:
      null
    • setColumnTitles

      public ColumnTree setColumnTitles(String... columnTitles) throws IllegalStateException
      With fixedColumns enabled, defines the header title for each column.
      Parameters:
      columnTitles - New columnTitles value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getColumnTitles

      public String[] getColumnTitles()
      With fixedColumns enabled, defines the header title for each column.
      Returns:
      Current columnTitles value. Default value is null
    • setColumnWidths

      public ColumnTree setColumnWidths(String... columnWidths) throws IllegalStateException
      With fixedColumns enabled, defines the pixel or % width per column.
      Parameters:
      columnWidths - New columnWidths value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getColumnWidths

      public String[] getColumnWidths()
      With fixedColumns enabled, defines the pixel or % width per column.
      Returns:
      Current columnWidths value. Default value is null
    • setCustomIconOpenProperty

      public ColumnTree setCustomIconOpenProperty(String customIconOpenProperty)
      This property allows the developer to rename the default node.showOpenIcon property.

      Note : This is an advanced setting

      Parameters:
      customIconOpenProperty - New customIconOpenProperty value. Default value is "showOpenIcon"
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getCustomIconOpenProperty

      public String getCustomIconOpenProperty()
      This property allows the developer to rename the default node.showOpenIcon property.
      Returns:
      Current customIconOpenProperty value. Default value is "showOpenIcon"
      See Also:
    • setCustomIconProperty

      public ColumnTree setCustomIconProperty(String customIconProperty)
      This property allows the developer to customize the icon displayed next to a node. Set 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.
      Note that if 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 appended.
      Parameters:
      customIconProperty - New customIconProperty value. Default value is "icon"
      Returns:
      ColumnTree instance, for chaining setter calls
    • getCustomIconProperty

      public String getCustomIconProperty()
      This property allows the developer to customize the icon displayed next to a node. Set 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.
      Note that if 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 appended.
      Returns:
      Current customIconProperty value. Default value is "icon"
    • setData

      public ColumnTree setData(Tree data)
      A Tree object consisting of nested TreeNodes 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()

      If this method is called after the component has been drawn/initialized: Set the Tree object this ColumnTree will view
      Parameters:
      data - Tree to show. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
    • getData

      public Tree getData()
      A Tree object consisting of nested TreeNodes 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()
      Returns:
      Returns the Tree object this ColumnTree is viewing. Default value is null
    • setDataFetchMode

      public ColumnTree setDataFetchMode(FetchMode dataFetchMode)
      How to fetch and manage records retrieve from the server. See 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 ResultSet.fetchMode applies.

      Specified by:
      setDataFetchMode in interface DataBoundComponent
      Parameters:
      dataFetchMode - New dataFetchMode value. Default value is "paged"
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getDataFetchMode

      public FetchMode getDataFetchMode()
      How to fetch and manage records retrieve from the server. See 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 ResultSet.fetchMode applies.

      Specified by:
      getDataFetchMode in interface DataBoundComponent
      Returns:
      Current dataFetchMode value. Default value is "paged"
      See Also:
    • getDataProperties

      public Tree getDataProperties()
      For a ColumnTree that uses a DataSource, these properties will be passed to the automatically-created ResultTree. This can be used for various customizations such as modifying the automatically-chosen Tree.parentIdField.
      Returns:
      Current dataProperties value. Default value is null
      See Also:
    • setDataSource

      public ColumnTree setDataSource(DataSource dataSource)
      The DataSource that this component should bind to for default fields and for performing DataSource requests.

      Can be specified as either a DataSource instance or the String ID of a DataSource.

      Specified by:
      setDataSource in interface DataBoundComponent
      Parameters:
      dataSource - New dataSource value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • setDataSource

      public ColumnTree setDataSource(String dataSource)
      The DataSource that this component should bind to for default fields and for performing DataSource requests.

      Can be specified as either a DataSource instance or the String ID of a DataSource.

      Specified by:
      setDataSource in interface DataBoundComponent
      Parameters:
      dataSource - New dataSource value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • setEmptyColumnMessages

      public ColumnTree setEmptyColumnMessages(String... emptyColumnMessages) throws IllegalStateException
      With fixedColumns enabled, defines each column's ListGrid.emptyMessage.
      Parameters:
      emptyColumnMessages - New emptyColumnMessages value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEmptyColumnMessages

      public String[] getEmptyColumnMessages()
      With fixedColumns enabled, defines each column's ListGrid.emptyMessage.
      Returns:
      Current emptyColumnMessages value. Default value is null
    • setFields

      public ColumnTree setFields(ListGridField... fields)
      An array of field objects, specifying the order, layout, dynamic calculation, and sorting behavior of each field in each column in the columnTree object. In ColumnTrees, the fields array specifies sub-columns within each main column. Each field in the fields array is a ListGridField object.

      If dataSource is also set, this value acts as a set of overrides as explained in DataBoundComponent.fields.

      Parameters:
      fields - New fields value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • setFirstColumnTitle

      public ColumnTree setFirstColumnTitle(String firstColumnTitle) throws IllegalStateException
      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). Ignored if showHeaders is not set.

      Note: if you do not want a heading for the first column leave this attribute at its default value of " ". If you set it to null or the empty string, Smart GWT will fall back to displaying the field's name in the heading.
      Parameters:
      firstColumnTitle - New firstColumnTitle value. Default value is " "
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getFirstColumnTitle

      public 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). Ignored if showHeaders is not set.

      Note: if you do not want a heading for the first column leave this attribute at its default value of " ". If you set it to null or the empty string, Smart GWT will fall back to displaying the field's name in the heading.
      Returns:
      Current firstColumnTitle value. Default value is " "
    • setFixedColumns

      public ColumnTree setFixedColumns(Integer fixedColumns) throws IllegalStateException
      Enables fixed columns mode. All columns are created in advance instead of as navigation occurs.
      Parameters:
      fixedColumns - New fixedColumns value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getFixedColumns

      public Integer getFixedColumns()
      Enables fixed columns mode. All columns are created in advance instead of as navigation occurs.
      Returns:
      Current fixedColumns value. Default value is null
    • setFolderIcon

      public ColumnTree setFolderIcon(String folderIcon)
      The URL of the base icon for all folder nodes in this columnTree. Note that this URL will have openIconSuffix or closedIconSuffix appended to indicate state changes if appropriate - see documentation on showOpenIcons
      Parameters:
      folderIcon - New folderIcon value. Default value is "[SKIN]folder.png"
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getFolderIcon

      public String getFolderIcon()
      The URL of the base icon for all folder nodes in this columnTree. Note that this URL will have openIconSuffix or closedIconSuffix appended to indicate state changes if appropriate - see documentation on showOpenIcons
      Returns:
      Current folderIcon value. Default value is "[SKIN]folder.png"
      See Also:
    • setLoadDataOnDemand

      public ColumnTree setLoadDataOnDemand(Boolean loadDataOnDemand) throws IllegalStateException
      For databound columnTree instances, should the entire tree of data be loaded on initial fetch, or should each column be loaded as needed. If unset the default ResultTree.loadDataOnDemand setting will be used.
      Parameters:
      loadDataOnDemand - New loadDataOnDemand value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getLoadDataOnDemand

      public Boolean getLoadDataOnDemand()
      For databound columnTree instances, should the entire tree of data be loaded on initial fetch, or should each column be loaded as needed. If unset the default ResultTree.loadDataOnDemand setting will be used.
      Returns:
      Current loadDataOnDemand value. Default value is null
      See Also:
    • setNodeIcon

      public ColumnTree setNodeIcon(String nodeIcon)
      The filename of the default icon for all leaf nodes in this grid. To specify a custom image for an individual node, set the customIconProperty directly on the node.

      See TreeGrid.showNodeIcons and TreeGrid.showFolderIcons for details on suppressing display of icons

      Parameters:
      nodeIcon - New nodeIcon value. Default value is "[SKIN]file.png"
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getNodeIcon

      public String getNodeIcon()
      The filename of the default icon for all leaf nodes in this grid. To specify a custom image for an individual node, set the customIconProperty directly on the node.

      See TreeGrid.showNodeIcons and TreeGrid.showFolderIcons for details on suppressing display of icons

      Returns:
      Current nodeIcon value. Default value is "[SKIN]file.png"
      See Also:
    • setOpenIconSuffix

      public ColumnTree setOpenIconSuffix(String openIconSuffix)
      If showOpenIcons is true, this suffix will be appended to the folderIcon for open folders in this grid.
      Parameters:
      openIconSuffix - New openIconSuffix value. Default value is "open"
      Returns:
      ColumnTree instance, for chaining setter calls
    • getOpenIconSuffix

      public String getOpenIconSuffix()
      If showOpenIcons is true, this suffix will be appended to the folderIcon for open folders in this grid.
      Returns:
      Current openIconSuffix value. Default value is "open"
    • setShowCustomIconOpen

      public ColumnTree setShowCustomIconOpen(Boolean showCustomIconOpen)
      Should folder nodes showing custom icons (set via the 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").
      Note that the closedIconSuffix is never appended to custom folder icons.
      Can be overridden at the node level via the default property TreeNode.showOpenIcon and that property can be renamed via TreeGrid.customIconOpenProperty.

      Note : This is an advanced setting

      Parameters:
      showCustomIconOpen - New showCustomIconOpen value. Default value is false
      Returns:
      ColumnTree instance, for chaining setter calls
    • getShowCustomIconOpen

      public Boolean getShowCustomIconOpen()
      Should folder nodes showing custom icons (set via the 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").
      Note that the closedIconSuffix is never appended to custom folder icons.
      Can be overridden at the node level via the default property TreeNode.showOpenIcon and that property can be renamed via TreeGrid.customIconOpenProperty.
      Returns:
      Current showCustomIconOpen value. Default value is false
    • setShowDetailFields

      public ColumnTree setShowDetailFields(Boolean showDetailFields) throws IllegalStateException
      Whether to show fields marked 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.

      Specified by:
      setShowDetailFields in interface DataBoundComponent
      Parameters:
      showDetailFields - New showDetailFields value. Default value is true
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getShowDetailFields

      public Boolean getShowDetailFields()
      Whether to show fields marked 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.

      Specified by:
      getShowDetailFields in interface DataBoundComponent
      Returns:
      Current showDetailFields value. Default value is true
      See Also:
    • setShowHeaders

      public ColumnTree setShowHeaders(Boolean showHeaders) throws IllegalStateException
      If set, each column in the ColumnTree will show a header with the title of the selected node from the column to the left.
      Parameters:
      showHeaders - New showHeaders value. Default value is false
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowHeaders

      public 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.
      Returns:
      Current showHeaders value. Default value is false
    • setShowMultipleColumns

      public ColumnTree setShowMultipleColumns(Boolean showMultipleColumns)
      When set to false, only displays a single column at a time, showing a slide animation when moving between columns.
      Parameters:
      showMultipleColumns - New showMultipleColumns value. Default value is null
      Returns:
      ColumnTree instance, for chaining setter calls
    • getShowMultipleColumns

      public Boolean getShowMultipleColumns()
      When set to false, only displays a single column at a time, showing a slide animation when moving between columns.
      Returns:
      Current showMultipleColumns value. Default value is null
    • setShowNodeCount

      public ColumnTree setShowNodeCount(Boolean showNodeCount) throws IllegalStateException
      If set, and showHeaders is also set, each column's header will show a count of the number of nodes in that column
      Parameters:
      showNodeCount - New showNodeCount value. Default value is false
      Returns:
      ColumnTree instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowNodeCount

      public 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
      Returns:
      Current showNodeCount value. Default value is false
    • setShowOpenIcons

      public ColumnTree setShowOpenIcons(Boolean showOpenIcons)
      If true, show a different icon for 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".
      Note If this property is set to 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.
      Parameters:
      showOpenIcons - New showOpenIcons value. Default value is true
      Returns:
      ColumnTree instance, for chaining setter calls
      See Also:
    • getShowOpenIcons

      public Boolean getShowOpenIcons()
      If true, show a different icon for 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".
      Note If this property is set to 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.
      Returns:
      Current showOpenIcons value. Default value is true
      See Also:
    • folderDrop

      public void folderDrop(TreeNode[] nodes, TreeNode folder, int index, Canvas sourceWidget)
      Process a drop of one or more nodes on a TreeGrid folder.
      Note: See TreeGridDrop for an overview of TreeGrid drag and drop behavior. Add logic in your drop handler to perform custom drop behaviors; to suppress the built-in behavior described below, use event.cancel()

      The default behavior is to simply delegate to the transferNodes() method; thus, the correct way to perform a programmatic folder drop, with all the built-in behaviors described below, is to call transferNodes()

      If this is a self-drop, nodes are simply reordered. An "update" operation will be submitted to update the parentId field of the moved node(s).

      For a drop from another widget, TreeGrid.transferDragData() is called which, depending on the dragDataAction specified on the source widget, may either remove the source nodes from the original list (dragDataAction:"move") or just provide a copy to this tree (dragDataAction:"copy").

      In either case the new row(s) appear in the folder at the index specified by the arguments of the same name.

      If this grid is databound, the new nodes will be added to the dataset by calling DataSource.addData(). Further, if the new nodes were dragged from another databound component, and addDropValues is true, getDropValues will be called for every item being dropped.

      As a special case, if the sourceWidget is also databound and a foreignKey relationship is declared from the sourceWidget's DataSource to this TreeGrid's DataSource, the interaction will be treated as a "drag recategorization" use case such as files being placed in folders, employees being assigned to teams, etc. "update" DSRequests will be submitted that change the foreignKey field in the dropped records to point to the tree folder that was the target of the drop. In this case no change will be made to the Tree data as such, only to the dropped records.

      For multi-record drops, Queuing is automatically used to combine all DSRequests into a single HTTP Request (see QuickStart Guide, Server Framework chapter). This allows the server to persist all changes caused by the drop in a single transaction (and this is automatically done when using the built-in server DataSources with Power Edition and above).

      If these default persistence behaviors are undesirable, use event.cancel(), then implement your own behavior, typically by using grid.updateData() or addData() to add new records.

      NOTE: the records you receive in this event are the actual Records from the source component. Use DataSource.copyRecords() to create a copy before modifying the records or using them with updateData() or addData().

      Parameters:
      nodes - List of nodes being dropped
      folder - The folder being dropped on
      index - Within the folder being dropped on, the index at which the drop is occurring. Only passed if canReorderRecords is true.
      sourceWidget - The component that is the source of the nodes (where the nodes were dragged from)
      See Also:
    • getColumnTitle

      public void getColumnTitle(TreeNode node, int colNum)
      Returns the title to show for the header of indicated column. Only called if shouldShowHeader() returns true for this column.

      By default, returns firstColumnTitle for the first column, and for subsequent columns, the result of this.data.getTitle() called on the node passed to this function.

      Parameters:
      node - parent node for the nodes to be shown in the column
      colNum - index of the column
    • getRecord

      public TreeNode getRecord(int index)
      Retrieve a record by 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.

      Parameters:
      index - index of record to return.
      Returns:
      node at the specified index
    • getRecord

      public TreeNode getRecord(int index, Integer colNum)
      Retrieve a record by 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.

      Parameters:
      index - index of record to return.
      colNum - optional index of the column
      Returns:
      node at the specified index
    • getSelectedRecord

      public Record getSelectedRecord()
      Get the selected record, that is, the parent of the nodes in the rightmost visible column.

      This is generally the most recently clicked node unless programmatic navigation has taken place.

      If only the first column is showing, the root node is returned (which can be detected via Tree.isRoot()).

      Returns:
      the selected record
    • shouldShowHeader

      public void shouldShowHeader(TreeNode node, int colNum)
      Whether the indicated column should show a header. Returns this.showHeaders by default, override for different behavior.
      Parameters:
      node - parent node for the nodes to be shown in the column
      colNum - index of the column
    • transferNodes

      public void transferNodes(TreeNode[] nodes, TreeNode folder, Integer index, Canvas sourceWidget)
      Transfer a list of TreeNodes within this treeGrid or from from some other component (does not have to be a databound component) into this component. This method is only applicable to list-type components, such as listGrid, treeGrid or tileGrid. Please see the paragraph below for special rules concerning multi-link trees.

      This method implements the automatic drag-copy and drag-move behavior and calling it is equivalent to completing a drag and drop of the nodes (the default folderDrop() implementation simply calls transferNodes())

      Note that this method is asynchronous - it may need to perform server turnarounds to prevent duplicates in the target component's data. If you wish to be notified when the transfer process has completed, you can either pass the optional callback to this method or implement the DataBoundComponent.dropComplete() method on this component.

      For a TreeGrid, see also transferSelectedData().

      Multi-link trees
      If both the target treeGrid and the sourceWidget for this transfer are multi-link treeGrids, the nodes parameter must be an array of NodeLocators rather than TreeNodes. Likewise, if the target (this) component is a multi-link treeGrid, the folder parameter must be a NodeLocator.

      You can obtain a NodeLocator for a visible node occurence in a multi-link TreeGrid by calling its data model's getNodeLocator() method.

      Parameters:
      nodes - Nodes to transfer to this component
      folder - The target folder (eg, of a drop interaction), for context
      index - Insert point within the target folder data for the transferred nodes
      sourceWidget - The databound or non-databound component from which the nodes are to be transferred.
      See Also:
    • transferNodes

      public void transferNodes(TreeNode[] nodes, TreeNode folder, Integer index, Canvas sourceWidget, String callback)
      Transfer a list of TreeNodes within this treeGrid or from from some other component (does not have to be a databound component) into this component. This method is only applicable to list-type components, such as listGrid, treeGrid or tileGrid. Please see the paragraph below for special rules concerning multi-link trees.

      This method implements the automatic drag-copy and drag-move behavior and calling it is equivalent to completing a drag and drop of the nodes (the default folderDrop() implementation simply calls transferNodes())

      Note that this method is asynchronous - it may need to perform server turnarounds to prevent duplicates in the target component's data. If you wish to be notified when the transfer process has completed, you can either pass the optional callback to this method or implement the DataBoundComponent.dropComplete() method on this component.

      For a TreeGrid, see also transferSelectedData().

      Multi-link trees
      If both the target treeGrid and the sourceWidget for this transfer are multi-link treeGrids, the nodes parameter must be an array of NodeLocators rather than TreeNodes. Likewise, if the target (this) component is a multi-link treeGrid, the folder parameter must be a NodeLocator.

      You can obtain a NodeLocator for a visible node occurence in a multi-link TreeGrid by calling its data model's getNodeLocator() method.

      Parameters:
      nodes - Nodes to transfer to this component
      folder - The target folder (eg, of a drop interaction), for context
      index - Insert point within the target folder data for the transferred nodes
      sourceWidget - The databound or non-databound component from which the nodes are to be transferred.
      callback - optional callback to be fired when the transfer process has completed. The callback will be passed a single parameter "records", the list of nodes actually transferred to this component (it is called "records" because this is logic shared with ListGrid). See Callback
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(ColumnTree columnTreeProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      columnTreeProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • onInit

      protected void onInit()
      Overrides:
      onInit in class Layout
    • onInit_ColumnTree

      protected void onInit_ColumnTree()
    • setDropIconSuffix

      public void setDropIconSuffix(String dropIconSuffix)
      If showDropIcons is true, this suffix will be appended to the folderIcon when the user drop-hovers over some folder.
      Parameters:
      dropIconSuffix - dropIconSuffix Default value is "drop"
    • getDropIconSuffix

      public String getDropIconSuffix()
      If showDropIcons is true, this suffix will be appended to the folderIcon when the user drop-hovers over some folder.
      Returns:
      String
    • setShowDropIcons

      public 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. This is achieved by appending the dropIconSuffix onto the folderIcon URL (for example "[SKIN]/folder.gif" may be replaced by "[SKIN]/folder_drop.gif").
      Parameters:
      showDropIcons - showDropIcons Default value is true
    • getShowDropIcons

      public Boolean getShowDropIcons()
      If true, when the user drags a droppable target over a folder in this TreeGrid, show a different icon folder icon. This is achieved by appending the dropIconSuffix onto the folderIcon URL (for example "[SKIN]/folder.gif" may be replaced by "[SKIN]/folder_drop.gif").
      Returns:
      Boolean
    • deselectRecord

      public void deselectRecord(Record record, int colNum)
    • deselectRecord

      public void deselectRecord(int record, int colNum)
      Deselect a Record passed in explicitly, or by index.

      Synonym for selectRecord(record, false)

      Parameters:
      record - row number to deselect
      colNum - the column number
    • deselectRecords

      public void deselectRecords(int[] records, int colNum)
      Deselect a list of Records passed in explicitly, or by index.

      Synonym for selectRecords(records, false)

      Parameters:
      records - records (or row numbers) to deselect
      colNum - the col num
    • deselectRecord

      public void deselectRecord(Record[] records)
      Deselect a list of Records passed in explicitly, or by index.

      Synonym for selectRecords(records, false)

      Parameters:
      records - records (or row numbers) to deselect
    • deselectRecords

      public void deselectRecords(Record[] records, int colNum)
      Deselect a list of Records passed in explicitly, or by index.

      Synonym for selectRecords(records, false)

      Parameters:
      records - records (or row numbers) to deselect
      colNum - the col num
    • selectRecord

      public void selectRecord(int record, boolean newState, int colNum)
      Select/deselect a Record passed in explicitly, or by index.
      Parameters:
      record - record (or row number) to select
      newState - new selection state (if null, defaults to true)
      colNum - Column number
    • selectRecord

      public void selectRecord(Record record, boolean newState, int colNum)
      Select/deselect a Record passed in explicitly, or by index.
      Parameters:
      record - record (or row number) to select
      newState - new selection state (if null, defaults to true)
      colNum - Column number
    • selectRecords

      public void selectRecords(int[] records, boolean newState, int colNum)
      Select/deselect a list of Records passed in explicitly, or by index.
      Parameters:
      records - records (or row numbers) to select
      newState - new selection state (if null, defaults to true)
      colNum - Column number
    • selectRecords

      public void selectRecords(Record[] records, boolean newState, int colNum)
      Select/deselect a list of Records passed in explicitly, or by index.
      Parameters:
      records - records (or row numbers) to select
      newState - new selection state (if null, defaults to true)
      colNum - Column number
    • getSelection

      public ListGridRecord[] getSelection(int colNum)
      Returns the array of objects selected in the specified column of the columnTree
      Parameters:
      colNum - Column within the columnTree to return the selection for
      Returns:
      (ArrayofListGridRecord) list of records, empty list if nothing selected
    • selectAllRecords

      public void selectAllRecords(int colNum)
      Select all records in the supplied column (the first column if none is passed)&#010&#010
      Parameters:
      colNum - Column number
    • deselectAllRecords

      public void deselectAllRecords(int colNum)
      Deselect all records in the supplied column (the first column if none is passed)&#010&#010
      Parameters:
      colNum - Column number
    • anySelected

      public Boolean anySelected(int colNum)
      Whether at least one item is selected in the supplied column (the first column if none is passed)&#010&#010
      Parameters:
      colNum - Column number
      Returns:
      true == at least one item is selected in the supplied column, false == nothing at all is selected in the supplied column (note that there may be selections&#010 in other columns in this columnTree)
    • addNodeSelectedHandler

      public HandlerRegistration addNodeSelectedHandler(NodeSelectedHandler handler)
      Add a onNodeSelected handler.

      Notification method fired when a node is selected. Return false to suppress default&#010 behavior.&#010

      Specified by:
      addNodeSelectedHandler in interface HasNodeSelectedHandlers
      Parameters:
      handler - the onNodeSelected handler
      Returns:
      HandlerRegistration used to remove this handler
    • setColumnProperties

      public void setColumnProperties(ListGrid columnProperties) throws IllegalStateException
      Standard set of properties to apply to each generated column in this columnTree. Developers may also override ColumnTree.getCustomColumnProperties to return dynamic properties based on the node being displayed.

      Note : This is an advanced setting

      Parameters:
      columnProperties - columnProperties Default value is null
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getColumnProperties

      public ListGrid getColumnProperties()
      Standard set of properties to apply to each generated column in this columnTree. Developers may also override ColumnTree.getColumnProperties to return dynamic properties based on the node being displayed.
      Returns:
      "template" listGrid with attributes that will be applied to each generated column
    • getCustomColumnProperties

      public ListGrid getCustomColumnProperties(TreeNode node, int colNum)
      Additional properties to apply to the ListGrid that will show the indicated column. Returns null by default. This method can be overridden to allow, for example, different styling, icons or row heights per column.
      Parameters:
      node - parent node for the nodes to be shown in the column
      colNum - index of the column
      Returns:
      "template" listgrid with dynamically determined attributes to apply to the generated column.
    • setDataSource

      public void setDataSource(DataSource dataSource, ListGridField... fields)
      Bind to a DataSource.

      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().

      Parameters:
      dataSource -
      fields -
    • setDataProperties

      public void setDataProperties(Tree resultTreeProperties)
      For databound ColumnTrees, this attribute can be used to customize the ResultTree object created for this ColumnTree when data is fetched.
      Parameters:
      resultTreeProperties - the data properties
    • setDataPageSize

      public ColumnTree setDataPageSize(int dataPageSize)
      Description copied from interface: DataBoundComponent
      When using data paging, how many records to fetch at a time. If set to a positive integer, dataPageSize will override the default resultSize for ResultSets automatically created when you call fetchData() (and similarly for the resultSize of ResultTrees). The default of 0 means to just use the default page size of the data container.

      Note that regardless of the dataPageSize setting, a component will always fetch all of data that it needs to draw. Settings such as showAllRecords:true, drawAllMaxCells and drawAheadRatio can cause more rows than the configured dataPageSize to be fetched.

      Specified by:
      setDataPageSize in interface DataBoundComponent
      Parameters:
      dataPageSize - dataPageSize Default value is 0
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getDataPageSize

      public int getDataPageSize()
      Description copied from interface: DataBoundComponent
      When using data paging, how many records to fetch at a time. If set to a positive integer, dataPageSize will override the default resultSize for ResultSets automatically created when you call fetchData() (and similarly for the resultSize of ResultTrees). The default of 0 means to just use the default page size of the data container.

      Note that regardless of the dataPageSize setting, a component will always fetch all of data that it needs to draw. Settings such as showAllRecords:true, drawAllMaxCells and drawAheadRatio can cause more rows than the configured dataPageSize to be fetched.

      Specified by:
      getDataPageSize in interface DataBoundComponent
      Returns:
      int
      See Also:
    • setUseAllDataSourceFields

      public ColumnTree setUseAllDataSourceFields(Boolean useAllDataSourceFields)
      Description copied from interface: DataBoundComponent
      If true, the set of fields given by the "default binding" (see &#010 fields) is used, with any fields specified in&#010 component.fields acting as overrides that can suppress or modify the&#010 display of individual fields, without having to list the entire set of fields that&#010 should be shown.&#010

      &#010 If component.fields contains fields that are not found in the DataSource,&#010 they will be shown after the most recently referred to DataSource field. If the new&#010 fields appear first, they will be shown first.

      Specified by:
      setUseAllDataSourceFields in interface DataBoundComponent
      Parameters:
      useAllDataSourceFields - useAllDataSourceFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getUseAllDataSourceFields

      public Boolean getUseAllDataSourceFields()
      Description copied from interface: DataBoundComponent
      If true, the set of fields given by the "default binding" (see &#010 fields) is used, with any fields specified in&#010 component.fields acting as overrides that can suppress or modify the&#010 display of individual fields, without having to list the entire set of fields that&#010 should be shown.&#010

      &#010 If component.fields contains fields that are not found in the DataSource,&#010 they will be shown after the most recently referred to DataSource field. If the new&#010 fields appear first, they will be shown first.

      Specified by:
      getUseAllDataSourceFields in interface DataBoundComponent
      Returns:
      Boolean
    • setSparseFieldState

      public ColumnTree setSparseFieldState(Boolean sparseFieldState)
      Description copied from interface: DataBoundComponent
      If true, ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String) will omit state information for hidden fields by default.
      Specified by:
      setSparseFieldState in interface DataBoundComponent
      Parameters:
      sparseFieldState - sparseFieldState Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSparseFieldState

      public Boolean getSparseFieldState()
      Description copied from interface: DataBoundComponent
      If true, ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String) will omit state information for hidden fields by default.
      Specified by:
      getSparseFieldState in interface DataBoundComponent
      Returns:
      Boolean
    • setShowHiddenFields

      public ColumnTree setShowHiddenFields(Boolean showHiddenFields)
      Description copied from interface: DataBoundComponent
      Whether to show fields marked hidden:true when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 The hidden property is used on DataSource fields to mark fields that are&#010 never of meaning to an end user.

      Specified by:
      setShowHiddenFields in interface DataBoundComponent
      Parameters:
      showHiddenFields - showHiddenFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getShowHiddenFields

      public Boolean getShowHiddenFields()
      Description copied from interface: DataBoundComponent
      Whether to show fields marked hidden:true when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 The hidden property is used on DataSource fields to mark fields that are&#010 never of meaning to an end user.

      Specified by:
      getShowHiddenFields in interface DataBoundComponent
      Returns:
      Boolean
    • setShowComplexFields

      public ColumnTree setShowComplexFields(Boolean showComplexFields)
      Description copied from interface: DataBoundComponent
      Whether to show fields of non-atomic types when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 If true, the component will show fields that declare a complex type, for example, a&#010 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a&#010 DataSource that declares the fields of a shipping address (city, street name, etc).&#010

      &#010 Such fields may need custom formatters or editors in order to create a usable interface,&#010 for example, an Address field in a ListGrid might use a custom formatter to combine the&#010 relevant fields of an address into one column, and might use a pop-up dialog for&#010 editing.

      Note : This is an advanced setting

      Specified by:
      setShowComplexFields in interface DataBoundComponent
      Parameters:
      showComplexFields - showComplexFields Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getShowComplexFields

      public Boolean getShowComplexFields()
      Description copied from interface: DataBoundComponent
      Whether to show fields of non-atomic types when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 If true, the component will show fields that declare a complex type, for example, a&#010 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a&#010 DataSource that declares the fields of a shipping address (city, street name, etc).&#010

      &#010 Such fields may need custom formatters or editors in order to create a usable interface,&#010 for example, an Address field in a ListGrid might use a custom formatter to combine the&#010 relevant fields of an address into one column, and might use a pop-up dialog for&#010 editing.

      Specified by:
      getShowComplexFields in interface DataBoundComponent
      Returns:
      Boolean
    • setFetchOperation

      public ColumnTree setFetchOperation(String fetchOperation)
      Description copied from interface: DataBoundComponent
      Operation ID this component should use when performing fetch operations.
      Specified by:
      setFetchOperation in interface DataBoundComponent
      Parameters:
      fetchOperation - fetchOperation Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getFetchOperation

      public String getFetchOperation()
      Description copied from interface: DataBoundComponent
      Operation ID this component should use when performing fetch operations.
      Specified by:
      getFetchOperation in interface DataBoundComponent
      Returns:
      String
    • setUpdateOperation

      public ColumnTree setUpdateOperation(String updateOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing update operations.
      Specified by:
      setUpdateOperation in interface DataBoundComponent
      Parameters:
      updateOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getUpdateOperation

      public String getUpdateOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing update operations.
      Specified by:
      getUpdateOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setAddOperation

      public ColumnTree setAddOperation(String addOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing add operations.
      Specified by:
      setAddOperation in interface DataBoundComponent
      Parameters:
      addOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getAddOperation

      public String getAddOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing add operations.
      Specified by:
      getAddOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setRemoveOperation

      public ColumnTree setRemoveOperation(String removeOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing remove operations.
      Specified by:
      setRemoveOperation in interface DataBoundComponent
      Parameters:
      removeOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getRemoveOperation

      public String getRemoveOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing remove operations.
      Specified by:
      getRemoveOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setExportFields

      public ColumnTree setExportFields(String[] exportFields)
      Description copied from interface: DataBoundComponent
      The list of field-names to export. If provided, the field-list in the exported output is &#010 limited and sorted as per the list.&#010

      &#010 If exportFields is not provided, the exported output includes all visible fields &#010 from this component, sorted as they appear.

      Specified by:
      setExportFields in interface DataBoundComponent
      Parameters:
      exportFields - exportFields Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getExportFields

      public String[] getExportFields()
      Description copied from interface: DataBoundComponent
      The list of field-names to export. If provided, the field-list in the exported output is &#010 limited and sorted as per the list.&#010

      &#010 If exportFields is not provided, the exported output includes all visible fields &#010 from this component, sorted as they appear.

      Specified by:
      getExportFields in interface DataBoundComponent
      Returns:
      the list of field-names to export.
    • setExportAll

      public ColumnTree setExportAll(Boolean exportAll)
      Description copied from interface: DataBoundComponent
      Setting exportAll to true prevents the component from passing its list of fields to the &#010 export call. The result is the export of all visible fields from fields.&#010

      &#010 If exportAll is false, an export operation will first consider &#010 exportFields, if it's set, and fall back on all visible fields from&#010 fields otherwise.

      Specified by:
      setExportAll in interface DataBoundComponent
      Parameters:
      exportAll - exportAll Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getExportAll

      public Boolean getExportAll()
      Description copied from interface: DataBoundComponent
      Setting exportAll to true prevents the component from passing its list of fields to the &#010 export call. The result is the export of all visible fields from fields.&#010

      &#010 If exportAll is false, an export operation will first consider &#010 exportFields, if it's set, and fall back on all visible fields from&#010 fields otherwise.

      Specified by:
      getExportAll in interface DataBoundComponent
      Returns:
      Boolean
    • setExportIncludeSummaries

      public ColumnTree setExportIncludeSummaries(Boolean exportIncludeSummaries)
      Description copied from interface: DataBoundComponent
      If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set
      Specified by:
      setExportIncludeSummaries in interface DataBoundComponent
      Parameters:
      exportIncludeSummaries - exportIncludeSummaries Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getExportIncludeSummaries

      public Boolean getExportIncludeSummaries()
      Description copied from interface: DataBoundComponent
      If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set
      Specified by:
      getExportIncludeSummaries in interface DataBoundComponent
      Returns:
      Boolean
    • setPreventDuplicates

      public ColumnTree setPreventDuplicates(Boolean preventDuplicates) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      If set, detect and prevent duplicate records from being transferred to this component, either via&#010 drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent). When a duplicate transfer is detected,&#010 a dialog will appear showing the duplicateDragMessage.&#010

      &#010 If the component either does not have a DataSource or has a DataSource with no&#010 primaryKey declared, duplicate checking is off by&#010 default. If duplicate checking is enabled, it looks for an existing record in the dataset&#010 that has all of the properties of the dragged record, and considers that a duplicate.&#010

      &#010 For DragDataAction:"copy" where the target DataSource is related to the source&#010 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current&#010 criteria, already has a record whose value for the foreignKey field matches the&#010 primaryKey of the record being transferred.&#010

      &#010 For example, consider dragging "employees" to "teams", where "teams" has a field&#010 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target&#010 grid has search criteria causing it to show all the members of one team. A duplicate -&#010 adding an employee to the same team twice - is when the target grid's dataset contains an&#010 record with "employeeId" matching the "id" field of the dropped employee.

      Specified by:
      setPreventDuplicates in interface DataBoundComponent
      Parameters:
      preventDuplicates - preventDuplicates Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getPreventDuplicates

      public Boolean getPreventDuplicates()
      Description copied from interface: DataBoundComponent
      If set, detect and prevent duplicate records from being transferred to this component, either via&#010 drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent). When a duplicate transfer is detected,&#010 a dialog will appear showing the duplicateDragMessage.&#010

      &#010 If the component either does not have a DataSource or has a DataSource with no&#010 primaryKey declared, duplicate checking is off by&#010 default. If duplicate checking is enabled, it looks for an existing record in the dataset&#010 that has all of the properties of the dragged record, and considers that a duplicate.&#010

      &#010 For DragDataAction:"copy" where the target DataSource is related to the source&#010 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current&#010 criteria, already has a record whose value for the foreignKey field matches the&#010 primaryKey of the record being transferred.&#010

      &#010 For example, consider dragging "employees" to "teams", where "teams" has a field&#010 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target&#010 grid has search criteria causing it to show all the members of one team. A duplicate -&#010 adding an employee to the same team twice - is when the target grid's dataset contains an&#010 record with "employeeId" matching the "id" field of the dropped employee.

      Specified by:
      getPreventDuplicates in interface DataBoundComponent
      Returns:
      Boolean
    • setDuplicateDragMessage

      public ColumnTree setDuplicateDragMessage(String duplicateDragMessage) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      Message to show when a user attempts to transfer duplicate records into this component, and&#010 preventDuplicates is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
      Specified by:
      setDuplicateDragMessage in interface DataBoundComponent
      Parameters:
      duplicateDragMessage - duplicateDragMessage Default value is "Duplicates not allowed"
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getDuplicateDragMessage

      public String getDuplicateDragMessage()
      Description copied from interface: DataBoundComponent
      Message to show when a user attempts to transfer duplicate records into this component, and&#010 preventDuplicates is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
      Specified by:
      getDuplicateDragMessage in interface DataBoundComponent
      Returns:
      String
    • setAddDropValues

      public ColumnTree setAddDropValues(Boolean addDropValues)
      Description copied from interface: DataBoundComponent
      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. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.

      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

      Specified by:
      setAddDropValues in interface DataBoundComponent
      Parameters:
      addDropValues - addDropValues Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getAddDropValues

      public Boolean getAddDropValues()
      Description copied from interface: DataBoundComponent
      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. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.

      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

      Specified by:
      getAddDropValues in interface DataBoundComponent
      Returns:
      Boolean
    • setDropValues

      public ColumnTree setDropValues(Map dropValues)
      Description copied from interface: DataBoundComponent
      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 Smart GWT will apply to the dropped object before updating it.

      If this property is not defined, Smart GWT 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

      Specified by:
      setDropValues in interface DataBoundComponent
      Parameters:
      dropValues - dropValues Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getDropValues

      public Map getDropValues()
      Description copied from interface: DataBoundComponent
      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 Smart GWT will apply to the dropped object before updating it.

      If this property is not defined, Smart GWT 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

      Specified by:
      getDropValues in interface DataBoundComponent
      Returns:
      Returns the "drop values" to apply to a record dropped on this component prior to update. Only&#010 applicable to databound components - see dropValues for more details. If multiple records &#010 are being dropped, this method is called for each of them in turn.&#010

      &#010 This method returns the following:&#010

        &#010
      • Nothing, if addDropValues is false
      • &#010
      • dropValues, if that property is set. If the component's criteria object is applicable (as explained&#010 in the next item), it is merged into dropValues, with properties in dropValues taking precedence.
      • &#010
      • The component's criteria object, if the most recent textMatchStyle for the component was "exact" &#010 and it is simple criteria (ie, not an AdvancedCriteria object)
      • &#010
      • Otherwise nothing
      • &#010
      &#010

      &#010 You can override this method if you need more complex setting of drop values than can be &#010 provided by simply supplying a dropValues object.&#010 &#010

    • setProgressiveLoading

      public ColumnTree setProgressiveLoading(Boolean progressiveLoading)
      Indicates whether or not this component will load its data progressively
      Parameters:
      progressiveLoading -
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getProgressiveLoading

      public Boolean getProgressiveLoading()
      Indicates whether or not this component will load its data progressively
      Returns:
      See Also:
    • setUseFlatFields

      public ColumnTree setUseFlatFields(Boolean useFlatFields) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      The useFlatFields flag causes all simple type fields anywhere in a nested&#010 set of DataSources to be exposed as a flat list for form binding. &#010

      &#010 useFlatFields is typically used with imported metadata, such as &#010 XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback) from a &#010 XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback), as a means of eliminating levels of XML&#010 nesting that aren't meaningful in a user interface, without the cumbersome and fragile&#010 process of mapping form fields to XML structures.&#010

      &#010 For example, having called WebService.getInputDS(java.lang.String) to retrieve the input message&#010 schema for a web service operation whose input message looks like this:&#010

      &#010 <FindServices>&#010     <searchFor>search text</searchFor>&#010     <Options>&#010         <caseSensitive>false</caseSensitive>&#010     </Options>&#010     <IncludeInSearch>&#010         <serviceName>true</serviceName>&#010         <documentation>true</documentation>&#010         <keywords>true</keywords>&#010     </IncludeInSearch>&#010 </FindServices>&#010 
      &#010 Setting useFlatFields on a DynamicForm that is bound to this input&#010 message schema would result in 5 FormItem reflecting the 5 simple type&#010 fields in the message.&#010

      &#010 For this form, the result of DynamicForm.getValues() might look&#010 like:&#010

      &#010

      {&#010    searchFor: "search text",&#010    caseSensitive: false,&#010    serviceName: true,&#010    documentation : true,&#010    keywords : true&#010 }
      &#010 When contacting a WebService, these values can be automatically&#010 mapped to the structure of the input message for a web service operation by setting&#010 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)) or by setting&#010 useFlatFields (for use with a DataSource that is&#010 'bound to a WSDL web service' via&#010 wsOperation). &#010

      &#010 Using these two facilities in conjunction (component.useFlatFields and&#010 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user&#010 presentation and when providing the data for XML messages.&#010

      &#010 You can also set useFlatFields to automatically enable &#010 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a&#010 particular operationType.&#010

      &#010 Note that useFlatFields is not generally recommended for use with structures&#010 where multiple simple type fields exist with the same name, however if used with such a&#010 structure, the first field to use a given name wins. "first" means the first field&#010 encountered in a depth first search. "wins" means only the first field will be present as a&#010 field when data binding.

      Specified by:
      setUseFlatFields in interface DataBoundComponent
      Parameters:
      useFlatFields - useFlatFields Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getUseFlatFields

      public Boolean getUseFlatFields()
      Description copied from interface: DataBoundComponent
      The useFlatFields flag causes all simple type fields anywhere in a nested&#010 set of DataSources to be exposed as a flat list for form binding. &#010

      &#010 useFlatFields is typically used with imported metadata, such as &#010 XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback) from a &#010 XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback), as a means of eliminating levels of XML&#010 nesting that aren't meaningful in a user interface, without the cumbersome and fragile&#010 process of mapping form fields to XML structures.&#010

      &#010 For example, having called WebService.getInputDS(java.lang.String) to retrieve the input message&#010 schema for a web service operation whose input message looks like this:&#010

      &#010 <FindServices>&#010     <searchFor>search text</searchFor>&#010     <Options>&#010         <caseSensitive>false</caseSensitive>&#010     </Options>&#010     <IncludeInSearch>&#010         <serviceName>true</serviceName>&#010         <documentation>true</documentation>&#010         <keywords>true</keywords>&#010     </IncludeInSearch>&#010 </FindServices>&#010 
      &#010 Setting useFlatFields on a DynamicForm that is bound to this input&#010 message schema would result in 5 FormItem reflecting the 5 simple type&#010 fields in the message.&#010

      &#010 For this form, the result of DynamicForm.getValues() might look&#010 like:&#010

      &#010

      {&#010    searchFor: "search text",&#010    caseSensitive: false,&#010    serviceName: true,&#010    documentation : true,&#010    keywords : true&#010 }
      &#010 When contacting a WebService, these values can be automatically&#010 mapped to the structure of the input message for a web service operation by setting&#010 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)) or by setting&#010 useFlatFields (for use with a DataSource that is&#010 'bound to a WSDL web service' via&#010 wsOperation). &#010

      &#010 Using these two facilities in conjunction (component.useFlatFields and&#010 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user&#010 presentation and when providing the data for XML messages.&#010

      &#010 You can also set useFlatFields to automatically enable &#010 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a&#010 particular operationType.&#010

      &#010 Note that useFlatFields is not generally recommended for use with structures&#010 where multiple simple type fields exist with the same name, however if used with such a&#010 structure, the first field to use a given name wins. "first" means the first field&#010 encountered in a depth first search. "wins" means only the first field will be present as a&#010 field when data binding.

      Specified by:
      getUseFlatFields in interface DataBoundComponent
      Returns:
      Boolean
    • setHiliteProperty

      public ColumnTree setHiliteProperty(String hiliteProperty)
      Description copied from interface: DataBoundComponent
      Marker that can be set on a record to flag that record as hilited. Should be set to a value&#010 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.
      Specified by:
      setHiliteProperty in interface DataBoundComponent
      Parameters:
      hiliteProperty - hiliteProperty Default value is "_hilite"
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getHiliteProperty

      public String getHiliteProperty()
      Description copied from interface: DataBoundComponent
      Marker that can be set on a record to flag that record as hilited. Should be set to a value&#010 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.
      Specified by:
      getHiliteProperty in interface DataBoundComponent
      Returns:
      String
    • editFields

      public void editFields()
      Shows a FieldPicker interface allowing end-users to rearrange the order and visibiility of the fields in the associated DataBoundComponent.
    • editHilites

      public void editHilites()
      Description copied from interface: DataBoundComponent
      Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent.
      Specified by:
      editHilites in interface DataBoundComponent
    • getHiliteState

      public String getHiliteState()
      Description copied from interface: DataBoundComponent
      Get the current hilites encoded as a String, for saving.
      Specified by:
      getHiliteState in interface DataBoundComponent
      Returns:
      the hilite state
    • setHiliteState

      public ColumnTree setHiliteState(String hiliteState)
      Description copied from interface: DataBoundComponent
      Set the current hilites based on a hiliteState String previously returned from getHilitesState.
      Specified by:
      setHiliteState in interface DataBoundComponent
      Parameters:
      hiliteState - hilites state encoded as a String
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setHilites

      public ColumnTree setHilites(Hilite[] hilites)
      Description copied from interface: DataBoundComponent
      Accepts an array of hilite objects and applies them to this DataBoundComponent. See also getHilites for a method of retrieving the hilite array for storage, including hilites manually added by the user.

      NOTE: This is only supported on ListGrid for now.

      Specified by:
      setHilites in interface DataBoundComponent
      Parameters:
      hilites - array of hilite objects
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getHilites

      public Hilite[] getHilites()
      Description copied from interface: DataBoundComponent
      Return the set of hilite-objects currently applied to this DataBoundComponent. These can be saved for storage and then restored to a component later via setHilites().
      Specified by:
      getHilites in interface DataBoundComponent
      Returns:
      array of hilite objects
    • setDragDataAction

      public ColumnTree setDragDataAction(DragDataAction dragDataAction)
      Description copied from interface: DataBoundComponent
      Indicates what to do with data dragged into another DataBoundComponent. See&#010 DragDataAction type for details.
      Specified by:
      setDragDataAction in interface DataBoundComponent
      Parameters:
      dragDataAction - dragDataAction Default value is Canvas.MOVE
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getDragDataAction

      public DragDataAction getDragDataAction()
      Description copied from interface: DataBoundComponent
      Indicates what to do with data dragged into another DataBoundComponent. See&#010 DragDataAction type for details.
      Specified by:
      getDragDataAction in interface DataBoundComponent
      Returns:
      DragDataAction
    • setDragTrackerStyle

      public ColumnTree setDragTrackerStyle(String dragTrackerStyle)
      Description copied from interface: DataBoundComponent
      CSS Style to apply to the drag tracker when dragging occurs on this component.
      Specified by:
      setDragTrackerStyle in interface DataBoundComponent
      Parameters:
      dragTrackerStyle - dragTrackerStyle Default value is "gridDragTracker"
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getDragTrackerStyle

      public String getDragTrackerStyle()
      Description copied from interface: DataBoundComponent
      CSS Style to apply to the drag tracker when dragging occurs on this component.
      Specified by:
      getDragTrackerStyle in interface DataBoundComponent
      Returns:
      String
    • setCanAddFormulaFields

      public ColumnTree setCanAddFormulaFields(Boolean canAddFormulaFields)
      Description copied from interface: DataBoundComponent
      Adds an item to the header context menu allowing users to launch a dialog to define a new&#010 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.&#010

      &#010 User-added formula fields can be persisted via ListGrid.getFieldState() and &#010 ListGrid.setFieldState(java.lang.String).

      Specified by:
      setCanAddFormulaFields in interface DataBoundComponent
      Parameters:
      canAddFormulaFields - canAddFormulaFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • addSummaryField

      public void addSummaryField()
      Description copied from interface: DataBoundComponent
      Convenience method to display a {@link com.smartgwt.client..SummaryBuilder} to create a new Summary Field. This &#010 is equivalent to calling DataBoundComponentGen#editSummaryField with &#010 no parameter.&#010&#010
      Specified by:
      addSummaryField in interface DataBoundComponent
    • addFormulaField

      public void addFormulaField()
      Description copied from interface: DataBoundComponent
      Convenience method to display a {@link com.smartgwt.client..FormulaBuilder} to create a new Formula Field. This &#010 is equivalent to calling DataBoundComponentGen#editFormulaField with &#010 no parameter.&#010&#010
      Specified by:
      addFormulaField in interface DataBoundComponent
    • getCanAddFormulaFields

      public Boolean getCanAddFormulaFields()
      Description copied from interface: DataBoundComponent
      Adds an item to the header context menu allowing users to launch a dialog to define a new&#010 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.&#010

      &#010 User-added formula fields can be persisted via ListGrid.getFieldState() and &#010 ListGrid.setFieldState(java.lang.String).

      Specified by:
      getCanAddFormulaFields in interface DataBoundComponent
      Returns:
      Boolean
    • setAddFormulaFieldText

      public ColumnTree setAddFormulaFieldText(String addFormulaFieldText)
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to add a formula field
      Specified by:
      setAddFormulaFieldText in interface DataBoundComponent
      Parameters:
      addFormulaFieldText - addFormulaFieldText Default value is "Add formula column..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getAddFormulaFieldText

      public String getAddFormulaFieldText()
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to add a formula field
      Specified by:
      getAddFormulaFieldText in interface DataBoundComponent
      Returns:
      String
    • setEditFormulaFieldText

      public ColumnTree setEditFormulaFieldText(String editFormulaFieldText)
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to edit a formula field
      Specified by:
      setEditFormulaFieldText in interface DataBoundComponent
      Parameters:
      editFormulaFieldText - editFormulaFieldText Default value is "Edit formula..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getEditFormulaFieldText

      public String getEditFormulaFieldText()
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to edit a formula field
      Specified by:
      getEditFormulaFieldText in interface DataBoundComponent
      Returns:
      String
    • setCanAddSummaryFields

      public ColumnTree setCanAddSummaryFields(Boolean canAddSummaryFields)
      Description copied from interface: DataBoundComponent
      Adds an item to the header context menu allowing users to launch a dialog to define a new&#010 text field that can contain both user-defined text and the formatted values present in other &#010 fields, using the {@link com.smartgwt.client..SummaryBuilder}.&#010

      &#010 User-added summary fields can be persisted via ListGrid.getFieldState() and &#010 ListGrid.setFieldState(java.lang.String).

      Specified by:
      setCanAddSummaryFields in interface DataBoundComponent
      Parameters:
      canAddSummaryFields - canAddSummaryFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getCanAddSummaryFields

      public Boolean getCanAddSummaryFields()
      Description copied from interface: DataBoundComponent
      Adds an item to the header context menu allowing users to launch a dialog to define a new&#010 text field that can contain both user-defined text and the formatted values present in other &#010 fields, using the {@link com.smartgwt.client..SummaryBuilder}.&#010

      &#010 User-added summary fields can be persisted via ListGrid.getFieldState() and &#010 ListGrid.setFieldState(java.lang.String).

      Specified by:
      getCanAddSummaryFields in interface DataBoundComponent
      Returns:
      Boolean
    • setAddSummaryFieldText

      public ColumnTree setAddSummaryFieldText(String addSummaryFieldText)
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to add a formula field
      Specified by:
      setAddSummaryFieldText in interface DataBoundComponent
      Parameters:
      addSummaryFieldText - addSummaryFieldText Default value is "Add summary column..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getAddSummaryFieldText

      public String getAddSummaryFieldText()
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to add a formula field
      Specified by:
      getAddSummaryFieldText in interface DataBoundComponent
      Returns:
      String
    • setEditSummaryFieldText

      public ColumnTree setEditSummaryFieldText(String editSummaryFieldText)
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to edit the formatter for a field
      Specified by:
      setEditSummaryFieldText in interface DataBoundComponent
      Parameters:
      editSummaryFieldText - editSummaryFieldText Default value is "Edit summary format..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getEditSummaryFieldText

      public String getEditSummaryFieldText()
      Description copied from interface: DataBoundComponent
      Text for a menu item allowing users to edit the formatter for a field
      Specified by:
      getEditSummaryFieldText in interface DataBoundComponent
      Returns:
      String
    • setSavedSearchId

      public ColumnTree setSavedSearchId(String savedSearchId)
      Description copied from interface: DataBoundComponent
      Optional identifier for saved searches that should be applied to this component.

      By default SavedSearches are associated with a component via its local ID and DataSource ID. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
      Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicit Canvas.ID.
      Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.

      Note: This is an advanced setting.

      Specified by:
      setSavedSearchId in interface DataBoundComponent
      Parameters:
      savedSearchId - New savedSearchId value. Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSavedSearchId

      public String getSavedSearchId()
      Description copied from interface: DataBoundComponent
      Optional identifier for saved searches that should be applied to this component.

      By default SavedSearches are associated with a component via its local ID and DataSource ID. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
      Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicit Canvas.ID.
      Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.

      Specified by:
      getSavedSearchId in interface DataBoundComponent
      Returns:
      Current savedSearchId value. Default value is null
    • setShowSavedSearchesByDS

      public ColumnTree setShowSavedSearchesByDS(boolean showSavedSearchesByDS) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      Whether to associate saved searches by default with the current DataSource of a component when a savedSearchId is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.

      If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.

      Note: This is an advanced setting

      Specified by:
      setShowSavedSearchesByDS in interface DataBoundComponent
      Parameters:
      showSavedSearchesByDS - New showSavedSearchesByDS value. Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowSavedSearchesByDS

      public boolean getShowSavedSearchesByDS()
      Description copied from interface: DataBoundComponent
      Whether to associate saved searches by default with the current DataSource of a component when a savedSearchId is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.

      If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.

      Specified by:
      getShowSavedSearchesByDS in interface DataBoundComponent
      Returns:
      Current showSavedSearchesByDS value. Default value is true
    • findAll

      public Record[] findAll(AdvancedCriteria adCriteria)
      Filters all objects according to the AdvancedCriteria passed
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      all matching Objects or null if none found
    • find

      public Record find(AdvancedCriteria adCriteria)
      Filters all objects according to the AdvancedCriteria passed and returns the first matching object or null if not found
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      first matching object or null if not found
    • findIndex

      public int findIndex(AdvancedCriteria adCriteria)
      Finds the index of the first Record that matches with the AdvacendCriteria passed.
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      index of the first matching Record or -1 if not found
    • findNextIndex

      public int findNextIndex(int startIndex, AdvancedCriteria adCriteria, int endIndex)
      Like RecordList.findIndex(java.util.Map), but considering the startIndex and endIndex parameters.
      Parameters:
      startIndex - first index to consider
      adCriteria - AdvancedCriteria to use to filter results
      endIndex - last index to consider
      Returns:
      index of the first matching Record or -1 if not found
    • findNextIndex

      public int findNextIndex(int startIndex, AdvancedCriteria adCriteria)
      Like RecordList.findIndex(java.util.Map), but considering the startIndex parameter.
      Parameters:
      startIndex - first index to consider
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      index of the first matching Record or -1 if not found
    • selectRecord

      public void selectRecord(Record record)
      Description copied from interface: DataBoundComponent
      Select/deselect a Record passed in explicitly, or by index.
      Specified by:
      selectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to select
    • selectRecord

      public void selectRecord(int record)
      Description copied from interface: DataBoundComponent
      Select/deselect a Record passed in explicitly, or by index.
      Specified by:
      selectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to select
    • selectRecord

      public void selectRecord(int record, boolean newState)
      Description copied from interface: DataBoundComponent
      Select/deselect a Record passed in explicitly, or by index.
      Specified by:
      selectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to select
      newState - new selection state (if null, defaults to true)
    • selectRecord

      public void selectRecord(Record record, boolean newState)
      Description copied from interface: DataBoundComponent
      Select/deselect a Record passed in explicitly, or by index.
      Specified by:
      selectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to select
      newState - new selection state (if null, defaults to true)
    • selectRecords

      public void selectRecords(int[] records)
      Description copied from interface: DataBoundComponent
      Select/deselect a list of Records passed in explicitly, or by index.
      Specified by:
      selectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to select
    • selectRecords

      public void selectRecords(int[] records, boolean newState)
      Description copied from interface: DataBoundComponent
      Select/deselect a list of Records passed in explicitly, or by index.
      Specified by:
      selectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to select
      newState - new selection state
    • selectRecords

      public void selectRecords(Record[] records)
      Description copied from interface: DataBoundComponent
      Select/deselect a list of Records passed in explicitly, or by index.
      Specified by:
      selectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to select
    • selectRecords

      public void selectRecords(Record[] records, boolean newState)
      Description copied from interface: DataBoundComponent
      Select/deselect a list of Records passed in explicitly, or by index.
      Specified by:
      selectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to select
      newState - new selection state (if null, defaults to true)
    • deselectRecord

      public void deselectRecord(Record record)
      Description copied from interface: DataBoundComponent
      Deselect a Record passed in explicitly, or by index.

      Synonym for selectRecord(record, false)

      Specified by:
      deselectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to deselect
    • deselectRecord

      public void deselectRecord(int record)
      Description copied from interface: DataBoundComponent
      Deselect a Record passed in explicitly, or by index.

      Synonym for selectRecord(record, false)

      Specified by:
      deselectRecord in interface DataBoundComponent
      Parameters:
      record - record (or row number) to deselect
    • deselectRecords

      public void deselectRecords(int[] records)
      Description copied from interface: DataBoundComponent
      Deselect a list of Records passed in explicitly, or by index.

      Synonym for selectRecords(records, false)

      Specified by:
      deselectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to deselect
    • deselectRecords

      public void deselectRecords(Record[] records)
      Description copied from interface: DataBoundComponent
      Deselect a list of Records passed in explicitly, or by index.

      Synonym for selectRecords(records, false)

      Specified by:
      deselectRecords in interface DataBoundComponent
      Parameters:
      records - records (or row numbers) to deselect
    • selectAllRecords

      public void selectAllRecords()
      Description copied from interface: DataBoundComponent
      Select all records&#010&#010
      Specified by:
      selectAllRecords in interface DataBoundComponent
    • deselectAllRecords

      public void deselectAllRecords()
      Description copied from interface: DataBoundComponent
      &#010 Deselect all records&#010&#010
      Specified by:
      deselectAllRecords in interface DataBoundComponent
    • anySelected

      public Boolean anySelected()
      Description copied from interface: DataBoundComponent
      Whether at least one item is selected&#010
      Specified by:
      anySelected in interface DataBoundComponent
      Returns:
      true == at least one item is selected false == nothing at all is selected
    • enableHilite

      public void enableHilite(String hiliteID)
      Description copied from interface: DataBoundComponent
      Enable / disable a hilites&#010&#010
      Specified by:
      enableHilite in interface DataBoundComponent
      Parameters:
      hiliteID - ID of hilite to enable
    • enableHilite

      public void enableHilite(String hiliteID, boolean enable)
      Description copied from interface: DataBoundComponent
      Enable / disable a hilites&#010&#010
      Specified by:
      enableHilite in interface DataBoundComponent
      Parameters:
      hiliteID - ID of hilite to enable
      enable - new enabled state to apply - if null, defaults to true
    • disableHilite

      public void disableHilite(String hiliteID)
      Description copied from interface: DataBoundComponent
      Disable a hilite&#010&#010
      Specified by:
      disableHilite in interface DataBoundComponent
      Parameters:
      hiliteID - ID of hilite to disable
    • enableHiliting

      public void enableHiliting()
      Description copied from interface: DataBoundComponent
      Enable all hilites.&#010&#010
      Specified by:
      enableHiliting in interface DataBoundComponent
    • enableHiliting

      public void enableHiliting(boolean enable)
      Description copied from interface: DataBoundComponent
      Enable all hilites.&#010&#010
      Specified by:
      enableHiliting in interface DataBoundComponent
      Parameters:
      enable - new enabled state to apply - if null, defaults to true
    • disableHiliting

      public void disableHiliting()
      Description copied from interface: DataBoundComponent
      Disable all hilites.&#010&#010
      Specified by:
      disableHiliting in interface DataBoundComponent
    • getDragData

      public Record[] getDragData()
      Description copied from interface: DataBoundComponent
      During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. In the default implementation, this is the list of currently selected records.

      This method is consulted by&#010 ListGrid.willAcceptDrop().

      Specified by:
      getDragData in interface DataBoundComponent
      Returns:
      Array of Records that are currently selected.
    • transferSelectedData

      public void transferSelectedData(DataBoundComponent source)
      Description copied from interface: DataBoundComponent
      Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by calling DataBoundComponent.getDropValues() for each dropped record.

      To transfer all data in, for example, a ListGrid, call grid.selection.selectAll() first.

      Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData() and/or the drop() method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, use HasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler). See the Dragging documentation for an overview of list grid drag/drop data transfer.

      Specified by:
      transferSelectedData in interface DataBoundComponent
      Parameters:
      source - source component from which the records will be tranferred
    • transferSelectedData

      public void transferSelectedData(DataBoundComponent source, int index)
      Description copied from interface: DataBoundComponent
      Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by calling DataBoundComponent.getDropValues() for each dropped record.

      To transfer all data in, for example, a ListGrid, call grid.selection.selectAll() first.

      Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData() and/or the drop() method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, use HasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler). See the Dragging documentation for an overview of list grid drag/drop data transfer.

      Specified by:
      transferSelectedData in interface DataBoundComponent
      Parameters:
      source - source component from which the records will be transferred
      index - target index (drop position) of the rows within this grid.
    • getRecordIndex

      public int getRecordIndex(Record record)
      Description copied from interface: DataBoundComponent
      Get the index of the provided record.&#010

      &#010 Override in subclasses to provide more specific behaviour, for instance, when data holds a&#010 large number of records&#010&#010

      Specified by:
      getRecordIndex in interface DataBoundComponent
      Parameters:
      record - the record whose index is to be retrieved
      Returns:
      indexindex of the record, or -1 if not found
    • getTitleFieldValue

      public String getTitleFieldValue(Record record)
      Description copied from interface: DataBoundComponent
      Get the value of the titleField for the passed record&#010

      &#010 Override in subclasses &#010&#010

      Specified by:
      getTitleFieldValue in interface DataBoundComponent
      Parameters:
      record - the record whose index is to be retrieved
      Returns:
      valuethe value of the titleField for the passed record
    • setTitleField

      public ColumnTree setTitleField(String titleField)
      Description copied from interface: DataBoundComponent
      Sets the best field to use for a user-visible title for an individual record from this component.
      Specified by:
      setTitleField in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getTitleField

      public String getTitleField()
      Description copied from interface: DataBoundComponent
      Method to return the fieldName which represents the "title" for records in this&#010 Component.
      &#010 If this.titleField is explicitly specified it will always be used.&#010 Otherwise, default implementation will check titleField for databound&#010 components.
      &#010 For non databound components returns the first defined field name of "title", &#010 "name", or "id". If we dont find any field-names that match these&#010 titles, the first field in the component will be used instead.&#010
      Specified by:
      getTitleField in interface DataBoundComponent
      Returns:
      fieldName the title field for this component.
    • getDataSource

      public DataSource getDataSource()
      Description copied from interface: DataBoundComponent
      The DataSource that this component should bind to for default fields and for performing DataSource requests.
      Specified by:
      getDataSource in interface DataBoundComponent
      Returns:
      DataSource
    • setAutoFetchData

      public ColumnTree setAutoFetchData(Boolean autoFetchData) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() . Criteria for this fetch may be picked up from initialCriteria and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle().

      NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only initialCriteria and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.

      Specified by:
      setAutoFetchData in interface DataBoundComponent
      Parameters:
      autoFetchData - autoFetchData
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException
    • getAutoFetchData

      public Boolean getAutoFetchData()
      Description copied from interface: DataBoundComponent
      If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() . Criteria for this fetch may be picked up from initialCriteria and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle().

      NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only initialCriteria and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.

      Specified by:
      getAutoFetchData in interface DataBoundComponent
      Returns:
      autoFetchData autoFetchData
    • setAutoFetchTextMatchStyle

      public ColumnTree setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial DataBoundComponent.fetchData() call.
      Specified by:
      setAutoFetchTextMatchStyle in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException
    • getAutoFetchTextMatchStyle

      public TextMatchStyle getAutoFetchTextMatchStyle()
      Description copied from interface: DataBoundComponent
      If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial DataBoundComponent.fetchData() call.
      Specified by:
      getAutoFetchTextMatchStyle in interface DataBoundComponent
      Returns:
      autoFetchTextMatchStyle autoFetchTextMatchStyle
    • setAutoFetchAsFilter

      public ColumnTree setAutoFetchAsFilter(Boolean autoFetchAsFilter) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()
      Specified by:
      setAutoFetchAsFilter in interface DataBoundComponent
      Parameters:
      autoFetchAsFilter - autoFetchAsFilter
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException
    • getAutoFetchAsFilter

      public Boolean getAutoFetchAsFilter()
      Description copied from interface: DataBoundComponent
      If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()
      Specified by:
      getAutoFetchAsFilter in interface DataBoundComponent
      Returns:
      auto fetch as filter
    • setInitialCriteria

      public ColumnTree setInitialCriteria(Criteria initialCriteria) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.
      Specified by:
      setInitialCriteria in interface DataBoundComponent
      Parameters:
      initialCriteria - the initial criteria
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getInitialCriteria

      public Criteria getInitialCriteria()
      Description copied from interface: DataBoundComponent
      Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.
      Specified by:
      getInitialCriteria in interface DataBoundComponent
      Returns:
      the criteria
    • setImplicitCriteria

      public ColumnTree setImplicitCriteria(Criteria implicitCriteria)
      Description copied from interface: DataBoundComponent
      Criteria that are never shown to or edited by the user and are cumulative with any criteria provided via DataBoundComponent.initialCriteria, DataBoundComponent.setCriteria() etc.
      Specified by:
      setImplicitCriteria in interface DataBoundComponent
      Parameters:
      implicitCriteria - New implicitCriteria value. Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setImplicitCriteria

      public Boolean setImplicitCriteria(Criteria implicitCriteria, DSCallback callback)
    • setImplicitCriteria

      public Boolean setImplicitCriteria(Criteria criteria, DSCallback callback, Boolean initialFetch)
    • getImplicitCriteria

      public Criteria getImplicitCriteria()
      Description copied from interface: DataBoundComponent
      Criteria that are never shown to or edited by the user and are cumulative with any criteria provided via DataBoundComponent.initialCriteria, DataBoundComponent.setCriteria() etc.
      Specified by:
      getImplicitCriteria in interface DataBoundComponent
      Returns:
      Current implicitCriteria value. Default value is null
    • fetchData

      public void fetchData()
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), 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 created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      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, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      Specified by:
      fetchData in interface DataBoundComponent
    • fetchData

      public void fetchData(Criteria criteria)
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), 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 created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      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, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      Specified by:
      fetchData in interface DataBoundComponent
      Parameters:
      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()
    • fetchData

      public void fetchData(Criteria criteria, DSCallback callback)
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), 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 created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      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, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      Specified by:
      fetchData in interface DataBoundComponent
      Parameters:
      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
    • fetchData

      public void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), 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 created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      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, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      Specified by:
      fetchData in interface DataBoundComponent
      Parameters:
      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
      requestProperties - additional properties to set on the DSRequest that will be issued
    • filterData

      public void filterData()
      Description copied from interface: DataBoundComponent
      Retrieves data that matches the provided criteria and displays the matching data in this component.

      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.

      Specified by:
      filterData in interface DataBoundComponent
    • filterData

      public void filterData(Criteria criteria)
      Description copied from interface: DataBoundComponent
      Retrieves data that matches the provided criteria and displays the matching data in this component.

      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.

      Specified by:
      filterData in interface DataBoundComponent
      Parameters:
      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()
    • filterData

      public void filterData(Criteria criteria, DSCallback callback)
      Description copied from interface: DataBoundComponent
      Retrieves data that matches the provided criteria and displays the matching data in this component.

      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.

      Specified by:
      filterData in interface DataBoundComponent
      Parameters:
      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 details
    • filterData

      public void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
      Description copied from interface: DataBoundComponent
      Retrieves data that matches the provided criteria and displays the matching data in this component.

      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.

      Specified by:
      filterData in interface DataBoundComponent
      Parameters:
      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 details
      requestProperties - for databound components only - optional additional properties to set on the DSRequest that will be issued
    • invalidateCache

      public void invalidateCache()
      Description copied from interface: DataBoundComponent
      Invalidate the current data cache for this databound component via a call to the dataset's invalidateCache() method, for example, ResultSet.invalidateCache().

      NOTE: there is no need to call invalidateCache() when a save operation is performed on a DataSource. Automatic cache synchronization features will automatically update caches - see ResultSet for details. If automatic cache synchronization isn't working, troubleshoot the problem using the steps suggested in the FAQ rather than just calling invalidateCache(). Calling invalidateCache() unnecessarily causes extra server load and added code complexity.

      Calling invalidateCache() will automatically cause a new fetch to be performed with the current set of criteria if data had been previously fetched and the component is currently drawn with data visible - there is no need to manually call fetchData() after invalidateCache() and this could result in duplicate fetches.

      While data is being re-loaded after a call to invalidateCache(), the widget is in a state similar to initial data load - it doesn't know the total length of the dataset and any APIs that act on records or row indices will necessarily fail and should not be called. To detect that the widget is in this state, call ResultSet.lengthIsKnown().

      invalidateCache() only has an effect if this component's dataset is a data manager class that manages a cache (eg ResultSet or ResultTree). If data was provided as a simple Array or List, invalidateCache() does nothing.

      Specified by:
      invalidateCache in interface DataBoundComponent
      See Also:
    • getResultSet

      public ResultSet getResultSet()
      Description copied from interface: DataBoundComponent
      Return the underlying data of this DataBoundComponent as a ResultSet.

      Note that this method should only be called after initial data has been fetched by this DataBoundComponent.

      Specified by:
      getResultSet in interface DataBoundComponent
      Returns:
      ResultSet, or null if the underlying data is not a ResultSet
      See Also:
    • getRecordList

      public RecordList getRecordList()
      Description copied from interface: DataBoundComponent
      Return the underlying data of this DataBoundComponent as a RecordList.

      Depending on the component configuration, the actual JavaScript instance of the returned RecordList may be one of several types:

      • If the component is not bound to a DataSource, the instance is generally an Array of Record.
      • If the component is bound to a DataSource, the instance is a ResultSet.
      • If the component is a grouped ListGrid, the instance is a Tree. To access the ungrouped record list regardless of grouping status, use
        isGrouped() ? getOriginalRecordList() : getRecordList()
      • If the component is a TreeGrid, the instance is a ResultTree.
      The underlying type determines the structure of the returned data. An Array or ResultSet represents a list of records, but a Tree or ResultTree represents a list of open rows in the tree, including groups or other nodes which contain no records.
      Specified by:
      getRecordList in interface DataBoundComponent
      Returns:
      the RecordList
    • getDataAsJSList

      public JavaScriptObject getDataAsJSList()
      Specified by:
      getDataAsJSList in interface DataBoundComponent
    • exportData

      public void exportData()
      Description copied from interface: DataBoundComponent
      Specified by:
      exportData in interface DataBoundComponent
    • exportData

      public void exportData(DSRequest requestProperties)
      Description copied from interface: DataBoundComponent
      Specified by:
      exportData in interface DataBoundComponent
    • exportData

      public void exportData(DSRequest requestProperties, RPCCallback callback)
      Description copied from interface: DataBoundComponent
      Uses a "fetch" operation on the current DataSource to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data to a file or window in the requested format.

      A variety of DSRequest settings, such as exportAs and exportFilename, affect the exporting process: see exportResults for further detail.

      Note that data exported via this method does not include any client-side formatting and relies on both the Smart GWT server and server-side DataSources. To export client-data with formatters applied, see exportClientData, which still requires the Smart GWT server but does not rely on server-side DataSources.

      For more information on exporting data, see DataSource.exportData.

      Specified by:
      exportData in interface DataBoundComponent
      Parameters:
      requestProperties - additional properties to set on DSRequest that will be issued
      callback - Optional callback. Note that this parameter only applies if you specify exportToClient: false in the request properties, because file downloads don't provide ordinary framework callbacks
      See Also:
    • addFetchDataHandler

      public HandlerRegistration addFetchDataHandler(FetchDataHandler handler)
      Add a fetchData handler.

      Notification function fired on fetchData() or filterData()

      Specified by:
      addFetchDataHandler in interface HasFetchDataHandlers
      Parameters:
      handler - the filterData handler
      Returns:
      HandlerRegistration used to remove this handler
    • addDropCompleteHandler

      public HandlerRegistration addDropCompleteHandler(DropCompleteHandler handler)
      Add a com.smartgwt.client.widgets.DropCompleteHandler. See that class's documentation for a definition of "drop complete", and how it differs from "drag complete" (com.smartgwt.client.widgets.DragCompleteHandler).
      Specified by:
      addDropCompleteHandler in interface HasDropCompleteHandlers
      Parameters:
      handler - the DropCompleteHandler
      Returns:
      HandlerRegistration used to remove this handler
    • addDragCompleteHandler

      public HandlerRegistration addDragCompleteHandler(DragCompleteHandler handler)
      Add a com.smartgwt.client.widgets.DragCompleteHandler. See that class's documentation for a definition of "drag complete", and how it differs from "drop complete" (com.smartgwt.client.widgets.DropCompleteHandler).
      Specified by:
      addDragCompleteHandler in interface HasDragCompleteHandlers
      Parameters:
      handler - the DropCompleteHandler
      Returns:
      HandlerRegistration used to remove this handler
    • getFieldAlignments

      public Alignment[] getFieldAlignments()
      Description copied from interface: DataBoundComponent
      Returna an array of field alignments for this grid
      Specified by:
      getFieldAlignments in interface DataBoundComponent
      Returns:
      array of Alignments
    • getDeepCloneOnEdit

      public Boolean getDeepCloneOnEdit()
      Description copied from interface: DataBoundComponent
      Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. See DataSource.getDeepCloneOnEdit() for details of what this means.

      If this value is not explicitly set, it defaults to the DataSource deepCloneOnEdit value. This value can also be overridden per-field with DataSourceField.setDeepCloneOnEdit(java.lang.Boolean).

      Like the other deepCloneOnEdit settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, using Canvas.setDataPath(java.lang.String)

      Specified by:
      getDeepCloneOnEdit in interface DataBoundComponent
    • setDeepCloneOnEdit

      public ColumnTree setDeepCloneOnEdit(Boolean deepCloneOnEdit)
      Description copied from interface: DataBoundComponent
      Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. See DataSource.getDeepCloneOnEdit() for details of what this means.

      If this value is not explicitly set, it defaults to the DataSource deepCloneOnEdit value. This value can also be overridden per-field with DataSourceField.setDeepCloneOnEdit(java.lang.Boolean).

      Like the other deepCloneOnEdit settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, using Canvas.setDataPath(java.lang.String)

      Specified by:
      setDeepCloneOnEdit in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setFields

      public ColumnTree setFields(JavaScriptObject... fields)
      Description copied from interface: DataBoundComponent
      Field setter variant (alternative to setFields(FormItem...), setFields(ListGridField...), etc.) that will accept an array of JavaScriptObject, rather than an array of SmartGWT Java wrappers of the field class type (e.g. FormItem, ListGridField, etc.) This is an advanced method and only for cases where you have the JavaScriptObject for each field but want to avoid having to create each associated SmartGWT Java wrapper.

      Note: use toArray() to create a Java array of JavaScriptObject if you only have the array itself as a single JavaScriptObject.

      Specified by:
      setFields in interface DataBoundComponent
      Parameters:
      fields - the component fields
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getFieldsAsJavaScriptObjects

      public JavaScriptObject[] getFieldsAsJavaScriptObjects()
      Description copied from interface: DataBoundComponent
      Return the fields as JavaScriptObjects rather than as SmartGWT Java wrappers of the field class type (e.g. FormItem, ListGridField, etc.) This avoids building the SmartGWT Java wrappers for the fields in situations where they aren't needed - and for FormItems in particular - where there may not be enough information to determine the correct subclass, such as before the SmartClient instance underlying the DynamicForm has been created.
      Specified by:
      getFieldsAsJavaScriptObjects in interface DataBoundComponent
      Returns:
      the component fields
    • getFieldCount

      public int getFieldCount()
      Description copied from interface: DataBoundComponent
      Return the number of fields.
      Specified by:
      getFieldCount in interface DataBoundComponent
      Returns:
      the number of fields
    • transferRecords

      public void transferRecords(Record[] records, Record targetRecord, Integer index, Canvas sourceWidget, TransferRecordsCallback callback)
      Description copied from interface: DataBoundComponent
      Transfer a list of Records from another component (does not have to be a databound component) into this component. This method is only applicable to list-type components, such as ListGrid or com.smartgwt.client.widgets.tile.TileGridTileGrid. Notably, it does not apply to TreeGrid; the equivalent for treeGrids is transferNodes.

      This method implements the automatic drag-copy and drag-move behaviors of components like ListGrid, and calling it is equivalent to completing a drag and drop of the dropRecords (the default record drop behavior is simply to call transferRecords(), passing in the dropped nodes)

      Note that this method is asynchronous - it may need to perform server turnarounds to prevent duplicates in the target component's data. If you wish to be notified when the transfer process has completed, you can either pass a non-null callback to this method or add a DropCompleteHandler to this component.

      See also transferSelectedData()

      Specified by:
      transferRecords in interface DataBoundComponent
      Parameters:
      records - Recordss to transfer to this component
      targetRecord - The target record (eg, of a drop interaction), for context
      index - Insert point relative to the target record for the transferred records
      sourceWidget - The databound or non-databound component from which the records are to be transferred.
      callback - optional TransferRecordsCallback to be fired when the transfer process has completed (pass null if your code does not need to be called back). The callback will be passed the list of records actually transferred to this component
    • setDragDataCustomizer

      public ColumnTree setDragDataCustomizer(DragDataCustomizer customizer)
      During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. In the default implementation, this is the list of currently selected records.

      This method is consulted by willAcceptDrop().

      Parameters:
      DragDataCustomizer - customizer
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSort

      public SortSpecifier[] getSort()
      Description copied from interface: DataBoundComponent
      Returns the current SortSpecifiers for this component. Will return null if this component has never been sorted, or the underlying SmartClient widget does not exist.
      Specified by:
      getSort in interface DataBoundComponent
      Returns:
      current sort specifiers for this component (null if unsorted or no SC widget)
    • setSort

      public ColumnTree setSort(SortSpecifier... sortSpecifiers)
      Description copied from interface: DataBoundComponent
      Sort the component on one or more fields.

      Pass in an array of SortSpecifiers to have the component's data sorted by the fields in each specifier.property and in the directions specified. The component can be sorted by any combination of fields, including fields specified in the fields array and unused fields from the underlying dataSource, if there is one.

      If setSort() is called on a component which doesn't yet have a SmartClient widget, the widget will be created. If autoFetchData is set and a DataSource has been set, this will result in data being fetched.

      Specified by:
      setSort in interface DataBoundComponent
      Parameters:
      sortSpecifiers - Array of SortSpecifier objects
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(ColumnTreeLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Layout