com.infragistics.faces.grid.component
Class GridView

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.infragistics.faces.shared.component.DataRepeater
              extended bycom.infragistics.faces.shared.component.DataList
                  extended bycom.infragistics.faces.grid.component.GridView
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
HtmlGridView

public class GridView
extends DataList

GridView is a very versatile and powerful component for displaying tabular data. It provides support for advanced features, such as:

Automatic Paging
The GridView component automatically handles paging through rows of data. To Enable automatic paging, simply set the pageSize property.

Automatic Sorting
The GridView component automatically provides support for sorting through columns. To Enable automatic sorting, simply set the sortBy property of the column(s) you want to sort-on.

Smart-Refresh (Built-in AJAX Support)
GridView leverages our unique Smart-Refresh technology to provide an unprecedented level of user-interaction, only available in desktop applications.
For instance, displaying a different page of data or sorting the grid, is actually done behind the scene as an AJAX request, considerably decreasing traffic over the wire and increasing the overall application performance.

Smart-DataBinding
GridView leverages our unique Smart-DataBinding technology which improves performance and bind the grid component to the underlying dataModel only when it's necessary and not on each request, as it's the case with default JSF components.

Bound and unbound mode
GridView supports both bound and unbound mode. In unbound mode, rowItems are either created declaratively (in a JSP page) or added programmatically.
In bound mode (whenever the dataSource property points to a valid data model of a backing bean) row items are automatically created by GridView, one node for each row of the data model.

Facets

The following facets can be nested inside the component:
Facet Name Description
bottomPager Specifies the bottom pager to use
footer Specifies the grid footer
header Specifies the grid header
topPager Specifies the top pager to use

Events


GridView fires the following events:


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String FACET_BOTTOM_PAGER
           
static java.lang.String FACET_FOOTER
           
static java.lang.String FACET_HEADER
           
static java.lang.String FACET_TOP_PAGER
           
static java.lang.String RENDERER_TYPE
           
static java.lang.String ROW_SELECTION_MULTIPLE
           
static java.lang.String ROW_SELECTION_SINGLE
           
 
Fields inherited from class com.infragistics.faces.shared.component.DataRepeater
DATA_ROW
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
GridView()
           
 
Method Summary
 void addSelectedRowsChangeListener(SelectedRowsChangeListener listener)
          Register a new SelectedRowsChangeListener to be notifiy of SelectedRowsChangeEvent
 void broadcast(javax.faces.event.FacesEvent event)
           
 javax.faces.component.UIComponent getBottomPager()
          Returns the bottom pager.
 java.util.List getColumns()
          Returns all columns defined for the grid
 java.lang.String getFamily()
           
 int getFixedColumnCount()
          Returns the specifies the number of columns that are not scrolling.
 javax.faces.component.UIComponent getFooter()
          Returns the grid footer if any
 javax.faces.component.UIComponent getHeader()
          Returns the grid header if any
static RowItem getRowItem(javax.faces.component.UIComponent component)
          Returns the RowItem the component is nested-in
 java.util.List getRows()
          Returns all rows contained in the grid
 java.util.List getSelectedRows()
          Returns an immutable list of selected rows.
 javax.faces.el.MethodBinding getSelectedRowsChangeListener()
          Returns the MethodBinding representing a SelectedRowsChangeListener method that is notified of SelectedRowsChangeEvent each time rows are about to be selected or unselected
 SelectedRowsChangeListener[] getSelectedRowsChangeListeners()
          Returns the set of registered SelectedRowsChangeListener for this component
 javax.faces.component.UIComponent getTopPager()
          Returns the top pager.
 boolean isBottomPagerRendered()
          Returns the bottom pager render (visibility) status
 boolean isTopPagerRendered()
          Returns the top pager render (visibility) status
 void processDecodes(javax.faces.context.FacesContext context)
           
 void removeSelectedRowsChangeListener(SelectedRowsChangeListener listener)
          Remove an existing SelectedRowsChangeListener (if any)
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setBottomPager(javax.faces.component.UIComponent pager)
          Sets the bottom pager.
 void setBottomPagerRendered(boolean bottomPagerRendered)
          Sets the bottom pager render (visibility) status
 void setFixedColumnCount(int fixedColumnCount)
          Sets the specifies the number of columns that are not scrolling.
 void setFooter(javax.faces.component.UIComponent footer)
          Sets the grid footer
 void setHeader(javax.faces.component.UIComponent header)
          Sets the grid header
 void setSelectedRowsChangeListener(javax.faces.el.MethodBinding selectedRowsChangeListener)
          Sets the MethodBinding representing a SelectedRowsChangeListener method that is notified of SelectedRowsChangeEvent each time rows are about to be selected or unselected
 void setTopPager(javax.faces.component.UIComponent pager)
          Sets the top pager.
 void setTopPagerRendered(boolean topPagerRendered)
          Sets the top pager render (visibility) status
 
Methods inherited from class com.infragistics.faces.shared.component.DataList
addPageChangeListener, addSortListener, firePageChangeEvent, fireSortEvent, getItemCount, getPageChangeListener, getPageChangeListeners, getPageCount, getPageIndex, getPageSize, getSortExpressionIndex, getSortExpressions, getSortListener, getSortListeners, isCustomPagingEnabled, isCustomSortingEnabled, removePageChangeListener, removeSortListener, setCustomPagingEnabled, setCustomSortingEnabled, setItemCount, setPageChangeListener, setPageIndex, setPageSize, setSortExpressions, setSortListener
 
Methods inherited from class com.infragistics.faces.shared.component.DataRepeater
dataBind, encodeBegin, encodeEnd, getDataKeyName, getDataKeyValue, getDataSource, getTemplateItems, processUpdates, processValidators, queueEvent, setDataKeyName, setDataSource, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponentBase
decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static java.lang.String COMPONENT_FAMILY

COMPONENT_TYPE

public static java.lang.String COMPONENT_TYPE

FACET_BOTTOM_PAGER

public static final java.lang.String FACET_BOTTOM_PAGER
See Also:
Constant Field Values

FACET_FOOTER

public static final java.lang.String FACET_FOOTER
See Also:
Constant Field Values

FACET_HEADER

public static final java.lang.String FACET_HEADER
See Also:
Constant Field Values

FACET_TOP_PAGER

public static final java.lang.String FACET_TOP_PAGER
See Also:
Constant Field Values

RENDERER_TYPE

public static java.lang.String RENDERER_TYPE

ROW_SELECTION_MULTIPLE

public static final java.lang.String ROW_SELECTION_MULTIPLE
See Also:
Constant Field Values

ROW_SELECTION_SINGLE

public static final java.lang.String ROW_SELECTION_SINGLE
See Also:
Constant Field Values
Constructor Detail

GridView

public GridView()
Method Detail

getRowItem

public static RowItem getRowItem(javax.faces.component.UIComponent component)
Returns the RowItem the component is nested-in

Parameters:
component -
Returns:
a RowItem or null

addSelectedRowsChangeListener

public void addSelectedRowsChangeListener(SelectedRowsChangeListener listener)
Register a new SelectedRowsChangeListener to be notifiy of SelectedRowsChangeEvent


broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class DataList
Throws:
javax.faces.event.AbortProcessingException

getBottomPager

public javax.faces.component.UIComponent getBottomPager()
Returns the bottom pager. A default pager is provided if none has been explictly defined.

Returns:
the bottom pager

getColumns

public java.util.List getColumns()
Returns all columns defined for the grid

Returns:
the list of Columns

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class DataList

getFixedColumnCount

public int getFixedColumnCount()
Returns the specifies the number of columns that are not scrolling. Note that all fixed columns are displayed on the left side of the grid

Returns:
int

getFooter

public javax.faces.component.UIComponent getFooter()
Returns the grid footer if any

Returns:
a UIComponent

getHeader

public javax.faces.component.UIComponent getHeader()
Returns the grid header if any

Returns:
a UIComponent

getRows

public java.util.List getRows()
Returns all rows contained in the grid

Returns:
the list of RowItem

getSelectedRows

public java.util.List getSelectedRows()
Returns an immutable list of selected rows. Each element of the list is a RowItem object

Returns:
List

getSelectedRowsChangeListener

public javax.faces.el.MethodBinding getSelectedRowsChangeListener()
Returns the MethodBinding representing a SelectedRowsChangeListener method that is notified of SelectedRowsChangeEvent each time rows are about to be selected or unselected

Returns:
javax.faces.el.MethodBinding

getSelectedRowsChangeListeners

public SelectedRowsChangeListener[] getSelectedRowsChangeListeners()
Returns the set of registered SelectedRowsChangeListener for this component

Returns:
SelectedRowsChangeListener[]

getTopPager

public javax.faces.component.UIComponent getTopPager()
Returns the top pager. A default pager is provided if none has been explictly defined.

Returns:
a UIComponent

isBottomPagerRendered

public boolean isBottomPagerRendered()
Returns the bottom pager render (visibility) status

Returns:
boolean

isTopPagerRendered

public boolean isTopPagerRendered()
Returns the top pager render (visibility) status

Returns:
boolean

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)

removeSelectedRowsChangeListener

public void removeSelectedRowsChangeListener(SelectedRowsChangeListener listener)
Remove an existing SelectedRowsChangeListener (if any)


restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class DataList
See Also:
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class DataList
See Also:
StateHolder.saveState(javax.faces.context.FacesContext)

setBottomPager

public void setBottomPager(javax.faces.component.UIComponent pager)
Sets the bottom pager.

Parameters:
pager -

setBottomPagerRendered

public void setBottomPagerRendered(boolean bottomPagerRendered)
Sets the bottom pager render (visibility) status

Parameters:
bottomPagerRendered - boolean

setFixedColumnCount

public void setFixedColumnCount(int fixedColumnCount)
Sets the specifies the number of columns that are not scrolling. Note that all fixed columns are displayed on the left side of the grid

Parameters:
fixedColumnCount - int

setFooter

public void setFooter(javax.faces.component.UIComponent footer)
Sets the grid footer

Parameters:
footer -

setHeader

public void setHeader(javax.faces.component.UIComponent header)
Sets the grid header

Parameters:
header -

setSelectedRowsChangeListener

public void setSelectedRowsChangeListener(javax.faces.el.MethodBinding selectedRowsChangeListener)
Sets the MethodBinding representing a SelectedRowsChangeListener method that is notified of SelectedRowsChangeEvent each time rows are about to be selected or unselected

Parameters:
selectedRowsChangeListener - MethodBinding

setTopPager

public void setTopPager(javax.faces.component.UIComponent pager)
Sets the top pager.

Parameters:
pager -

setTopPagerRendered

public void setTopPagerRendered(boolean topPagerRendered)
Sets the top pager render (visibility) status

Parameters:
topPagerRendered - boolean