GridContext Class
- public final class GridContext
extends Object
A JavaBean that represents the runtime data of a specific Grid tag instance.
This bean provides access to properties about a Grid tag without having
to have a reference to the Grid tag itself. Upon initialization, the Grid
will create a GridContext object that the GridComponent
class will
provide to its subclasses.
Information provided here includes the JavaBean that encapsulates the style
data about a Grid and a DataContext
object which exposes the data and metadata that a Grid will use to render.
A GridContext is both created and destroyed in a Grid tag's lifecycle. It is
guaranteed to be dereferenced by the Grid in its Grid.release()
JSP
lifecycle method call.
-
Hierarchy
-
Object
GridContext
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GridContext
public GridContext()
- Create a GridContext object. This initializes the DataContext to a basic, empty
DataContext that provides basic data services to Grid tags. If an error occurs in
creating a real DataContext that is specific to the dataset of the Grid,
the empty DataContext may be used to render the grid in an empty state.
getAutoRender() Method
public boolean getAutoRender()
Get the Grid's autoRender attribute, Grid.setAutoRender(boolean)
.
Returns
- the autoRender attribute
getDataContext() Method
public DataContext
getDataContext()
Get the DataContext that contains the data the Grid will render
Returns
- the DataContext object
getDataSource() Method
public String
getDataSource()
Get the dataSource attribute.
Returns
- the expression that references the data a Grid will render.
getGridStyle() Method
public GridStyleContext
getGridStyle()
Get a JavaBean that contains the style information for the grid.
Returns
- the style information for the Grid
getImageRoot() Method
public String
getImageRoot()
getName() Method
public String
getName()
Get the name of the Grid.
Returns
- the name of the Grid
setDataContext(DataContext) Method
public void setDataContext(DataContext
dataContext)
throws DataContextException
Set the DataContext
object
that the Grid uses to render data from a data set. It is illegal to try to set a
null
DataContext on a GridContext.
Parameters
-
dataContext
- the DataContext object to set.
Exceptions
-
DataContextException
- if the dataContext parameter is null
Related Topics
DataContext
setDataSource(String) Method
public void setDataSource(String
dataSource)
Set the dataSource attribute from the Grid tag. This attribute is an
expression that references a dataset that should be rendered in the grid.
Parameters
-
dataSource
- the expression that references an Object which the grid will render.
setGridStyle(GridStyleContext) Method
public void setGridStyle(GridStyleContext
gridStyleContext)
Set a GridStyleContext
JavaBean that
contains style information for the grid.
Parameters
-
gridStyleContext
- the style information for the Grid
setImageRoot(String) Method
public void setImageRoot(String
imageRoot)
setName(String) Method
public void setName(String
name)
Set the name of the Grid using the Grid tag's Grid.setName(String)
attribute.
Parameters
-
name
- the Grid tag's name attribute