Class TableView

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, HasFormulaUpdatedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasBodyKeyPressHandlers, HasCellClickHandlers, HasCellContextClickHandlers, HasCellDoubleClickHandlers, HasCellErrorIconHoverHandlers, HasCellErrorIconOutHandlers, HasCellErrorIconOverHandlers, HasCellHoverHandlers, HasCellMouseDownHandlers, HasCellMouseUpHandlers, HasCellOutHandlers, HasCellOverHandlers, HasCellSavedHandlers, HasCellSelectionChangedHandlers, HasCellValueHoverHandlers, HasCriteriaChangedHandlers, HasDataArrivedHandlers, HasDataChangedHandlers, HasDrawAreaChangedHandlers, HasEditCompleteHandlers, HasEditFailedHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFieldStateChangedHandlers, HasFilterEditorSubmitHandlers, HasGroupByCompleteHandlers, HasGroupByHandlers, HasGroupStateChangedHandlers, HasGroupTreeChangedHandlers, HasHeaderClickHandlers, HasHeaderDoubleClickHandlers, HasHeaderHoverHandlers, HasHilitesChangedHandlers, HasRecordClickHandlers, HasRecordCollapseHandlers, HasRecordDoubleClickHandlers, HasRecordDropHandlers, HasRecordExpandHandlers, HasRegroupHandlers, HasRemoveRecordClickHandlers, HasRowContextClickHandlers, HasRowEditorEnterHandlers, HasRowEditorExitHandlers, HasRowHoverHandlers, HasRowMouseDownHandlers, HasRowMouseUpHandlers, HasRowOutHandlers, HasRowOverHandlers, HasSelectionChangedHandlers, HasSelectionUpdatedHandlers, HasSetSortHandlers, HasSortChangedHandlers, HasSorterClickHandlers, HasSorterContextClickHandlers, HasViewStateChangedHandlers, HasMembersChangedHandlers, HasImageClickHandlers, HasRecordNavigationClickHandlers

public class TableView extends ListGrid implements HasImageClickHandlers, HasRecordNavigationClickHandlers
Shows a listing of records with one or more fields from each record, with built-in support for navigation and editing of lists of records.

The TableView provides built-in controls such as navigation arrows and shows fields from the provided records in one of several built-in RecordLayouts.

NOTE: This widget is intended primarily for creating handset/phone-sized interfaces and does not have an appearance in any skin other than Mobile.

  • Constructor Details

    • TableView

      public TableView()
    • TableView

      public TableView(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static TableView 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 ListGrid
    • setCanSaveSearches

      public TableView setCanSaveSearches(boolean canSaveSearches) throws IllegalStateException
      Option to save searches is disabled for TableView

      Note : This is an advanced setting

      Overrides:
      setCanSaveSearches in class ListGrid
      Parameters:
      canSaveSearches - New canSaveSearches value. Default value is false
      Returns:
      TableView instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCanSaveSearches

      public boolean getCanSaveSearches()
      Option to save searches is disabled for TableView
      Overrides:
      getCanSaveSearches in class ListGrid
      Returns:
      Current canSaveSearches value. Default value is false
    • setCanShowFilterEditor

      public TableView setCanShowFilterEditor(boolean canShowFilterEditor) throws IllegalStateException
      Option to show filter editor is disabled for TableView

      Note : This is an advanced setting

      Overrides:
      setCanShowFilterEditor in class ListGrid
      Parameters:
      canShowFilterEditor - New canShowFilterEditor value. Default value is false
      Returns:
      TableView instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCanShowFilterEditor

      public boolean getCanShowFilterEditor()
      Option to show filter editor is disabled for TableView
      Overrides:
      getCanShowFilterEditor in class ListGrid
      Returns:
      Current canShowFilterEditor value. Default value is false
      See Also:
    • setDataField

      public TableView setDataField(String dataField)
      Field to display as part of individual record in "summary" RecordLayouts.
      Parameters:
      dataField - New dataField value. Default value is "data"
      Returns:
      TableView instance, for chaining setter calls
    • getDataField

      public String getDataField()
      Field to display as part of individual record in "summary" RecordLayouts.
      Returns:
      Current dataField value. Default value is "data"
    • setDescriptionField

      public TableView setDescriptionField(String descriptionField)
      Field to display as part of individual record in all RecordLayouts except "titleOnly".
      Parameters:
      descriptionField - New descriptionField value. Default value is "description"
      Returns:
      TableView instance, for chaining setter calls
    • getDescriptionField

      public String getDescriptionField()
      Field to display as part of individual record in all RecordLayouts except "titleOnly".
      Returns:
      Current descriptionField value. Default value is "description"
    • setIconField

      public TableView setIconField(String iconField)
      This property allows the developer to specify the icon displayed next to a record. Set record[tableView.iconField] to the URL of the desired icon to display. Only applies if showIconField is true.
      Parameters:
      iconField - New iconField value. Default value is "icon"
      Returns:
      TableView instance, for chaining setter calls
    • getIconField

      public String getIconField()
      This property allows the developer to specify the icon displayed next to a record. Set record[tableView.iconField] to the URL of the desired icon to display. Only applies if showIconField is true.
      Returns:
      Current iconField value. Default value is "icon"
    • setInfoField

      public TableView setInfoField(String infoField)
      Field to display as part of individual record in "summary" RecordLayouts.
      Parameters:
      infoField - New infoField value. Default value is "info"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getInfoField

      public String getInfoField()
      Field to display as part of individual record in "summary" RecordLayouts.
      Returns:
      Current infoField value. Default value is "info"
      See Also:
    • setNavIcon

      public TableView setNavIcon(String navIcon)
      The navigation icon shown next to records when showNavigation is true and NavigationMode is set to "navIconOny".
      Parameters:
      navIcon - New navIcon value. Default value is "[SKINIMG]/iOS/listArrow_button.png"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getNavIcon

      public String getNavIcon()
      The navigation icon shown next to records when showNavigation is true and NavigationMode is set to "navIconOny".
      Returns:
      Current navIcon value. Default value is "[SKINIMG]/iOS/listArrow_button.png"
      See Also:
    • setNavigationMode

      public TableView setNavigationMode(NavigationMode navigationMode)
      Set navigation mode for this TableView.
      Parameters:
      navigationMode - New navigationMode value. Default value is "wholeRecord"
      Returns:
      TableView instance, for chaining setter calls
    • getNavigationMode

      public NavigationMode getNavigationMode()
      Set navigation mode for this TableView.
      Returns:
      Current navigationMode value. Default value is "wholeRecord"
    • setRecordDataStyle

      public TableView setRecordDataStyle(String recordDataStyle)
      Default style for data field.
      Parameters:
      recordDataStyle - New recordDataStyle value. Default value is "recordData"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getRecordDataStyle

      public String getRecordDataStyle()
      Default style for data field.
      Returns:
      Current recordDataStyle value. Default value is "recordData"
      See Also:
    • setRecordDescriptionStyle

      public TableView setRecordDescriptionStyle(String recordDescriptionStyle)
      Default style for description.
      Parameters:
      recordDescriptionStyle - New recordDescriptionStyle value. Default value is "recordDescription"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getRecordDescriptionStyle

      public String getRecordDescriptionStyle()
      Default style for description.
      Returns:
      Current recordDescriptionStyle value. Default value is "recordDescription"
      See Also:
    • setRecordInfoStyle

      public TableView setRecordInfoStyle(String recordInfoStyle)
      Default style for info field.
      Parameters:
      recordInfoStyle - New recordInfoStyle value. Default value is "recordInfo"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getRecordInfoStyle

      public String getRecordInfoStyle()
      Default style for info field.
      Returns:
      Current recordInfoStyle value. Default value is "recordInfo"
      See Also:
    • setRecordLayout

      public TableView setRecordLayout(RecordLayout recordLayout)
      Sets the arrangement of data fields from the record.

      Note that controls supported by the TableView itself, such as navigation icons, are implicitly added to the data fields described in the RecordLayout. If an iconField has been configured, it too is an implicitly shown field, to the left of the area controlled by RecordLayout.

      Parameters:
      recordLayout - New recordLayout value. Default value is "titleOnly"
      Returns:
      TableView instance, for chaining setter calls
    • getRecordLayout

      public RecordLayout getRecordLayout()
      Sets the arrangement of data fields from the record.

      Note that controls supported by the TableView itself, such as navigation icons, are implicitly added to the data fields described in the RecordLayout. If an iconField has been configured, it too is an implicitly shown field, to the left of the area controlled by RecordLayout.

      Returns:
      Current recordLayout value. Default value is "titleOnly"
    • setRecordNavigationProperty

      public TableView setRecordNavigationProperty(String recordNavigationProperty)
      Boolean property on each record that controls whether navigation controls are shown for that record. If property is not defined on the record a navigation icon is shown if showNavigation is true.
      Parameters:
      recordNavigationProperty - New recordNavigationProperty value. Default value is "_navigate"
      Returns:
      TableView instance, for chaining setter calls
    • getRecordNavigationProperty

      public String getRecordNavigationProperty()
      Boolean property on each record that controls whether navigation controls are shown for that record. If property is not defined on the record a navigation icon is shown if showNavigation is true.
      Returns:
      Current recordNavigationProperty value. Default value is "_navigate"
    • setRecordTitleStyle

      public TableView setRecordTitleStyle(String recordTitleStyle)
      Default style for title.
      Parameters:
      recordTitleStyle - New recordTitleStyle value. Default value is "recordTitle"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getRecordTitleStyle

      public String getRecordTitleStyle()
      Default style for title.
      Returns:
      Current recordTitleStyle value. Default value is "recordTitle"
      See Also:
    • setShowIconField

      public TableView setShowIconField(Boolean showIconField)
      Should an icon field be shown for each record? A column in the table is set aside for an icon as specified on each record in the iconField.
      Parameters:
      showIconField - New showIconField value. Default value is true
      Returns:
      TableView instance, for chaining setter calls
    • getShowIconField

      public Boolean getShowIconField()
      Should an icon field be shown for each record? A column in the table is set aside for an icon as specified on each record in the iconField.
      Returns:
      Current showIconField value. Default value is true
    • setShowNavigation

      public TableView setShowNavigation(Boolean showNavigation)
      Whether to show navigation controls by default on all records. Can also be configured per-record with recordNavigationProperty.
      Parameters:
      showNavigation - New showNavigation value. Default value is null
      Returns:
      TableView instance, for chaining setter calls
    • getShowNavigation

      public Boolean getShowNavigation()
      Whether to show navigation controls by default on all records. Can also be configured per-record with recordNavigationProperty.
      Returns:
      Current showNavigation value. Default value is null
    • setTableMode

      public TableView setTableMode(TableMode tableMode)
      The display mode of the table.
      Parameters:
      tableMode - New tableMode value. Default value is "plain"
      Returns:
      TableView instance, for chaining setter calls
    • getTableMode

      public TableMode getTableMode()
      The display mode of the table.
      Returns:
      Current tableMode value. Default value is "plain"
    • setTitleField

      public TableView setTitleField(String titleField)
      Field to display for an individual record as the main title.
      Specified by:
      setTitleField in interface DataBoundComponent
      Overrides:
      setTitleField in class ListGrid
      Parameters:
      titleField - New titleField value. Default value is "title"
      Returns:
      TableView instance, for chaining setter calls
    • getTitleField

      public String getTitleField()
      Field to display for an individual record as the main title.
      Specified by:
      getTitleField in interface DataBoundComponent
      Overrides:
      getTitleField in class ListGrid
      Returns:
      Current titleField value. Default value is "title"
    • setWholeRecordNavIcon

      public TableView setWholeRecordNavIcon(String wholeRecordNavIcon)
      The navigation icon shown next to records when showNavigation is true and NavigationMode is set to "wholeRecord".
      Parameters:
      wholeRecordNavIcon - New wholeRecordNavIcon value. Default value is "[SKINIMG]/iOS/listArrow.png"
      Returns:
      TableView instance, for chaining setter calls
      See Also:
    • getWholeRecordNavIcon

      public String getWholeRecordNavIcon()
      The navigation icon shown next to records when showNavigation is true and NavigationMode is set to "wholeRecord".
      Returns:
      Current wholeRecordNavIcon value. Default value is "[SKINIMG]/iOS/listArrow.png"
      See Also:
    • addImageClickHandler

      public HandlerRegistration addImageClickHandler(ImageClickHandler handler)
      Add a imageClick handler.

      Executed when the user clicks on the image displayed in a record if TableView.iconField has been specified.

      Specified by:
      addImageClickHandler in interface HasImageClickHandlers
      Parameters:
      handler - the imageClick handler
      Returns:
      HandlerRegistration used to remove this handler
    • addRecordNavigationClickHandler

      public HandlerRegistration addRecordNavigationClickHandler(RecordNavigationClickHandler handler)
      Add a recordNavigationClick handler.

      Executed when the user clicks on a record, or on the navigate icon for a record depending on NavigationMode.

      Specified by:
      addRecordNavigationClickHandler in interface HasRecordNavigationClickHandlers
      Parameters:
      handler - the recordNavigationClick handler
      Returns:
      HandlerRegistration used to remove this handler
    • setDefaultProperties

      public static void setDefaultProperties(TableView tableViewProperties)
      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:
      tableViewProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setRecordFormatter

      public void setRecordFormatter(RecordFormatter formatter)
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(TableViewLogicalStructure 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 ListGrid