org.apache.beehive.netui.tags.databinding.datagrid
Class GetDataGridState

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by GetDataGridState
All Implemented Interfaces:
JspTag, SimpleTag, INetuiTag

public class GetDataGridState
extends AbstractSimpleTag

Utility data grid tag that allows the page author to gain access to the DataGridState object outside of the body of a <netui-data:dataGrid> tag. When building UI for sorting, filtering, or paging, this UI does not need to exist inside of the HTML table rendered by the data grid tags. In order to render UI for sorting, filtering, and paging, it is often necessary to gain access to the state exposed to a data grid via the DataGridState object. For example:

   <netui-data:getDataGridState gridName="employees" var="employeeGridState"/>
   <c:if test="${pageScope.employeeGridState.sortModel.sorts} != null}">
     ... render UI when sorts are present ...
   </c:if>
 
this will expose the "employees" data grid's list of SortModel.getSorts() to the JSP for access by the JSP EL.


Constructor Summary
GetDataGridState()
           
 
Method Summary
 void doTag()
          Using a DataGridConfig object, access the DataGridState and place it in the JspContext under the attribute key set via setVar(String)
 String getTagName()
          The name of this tag; this value is used for error reporting.
 void setDataGridConfig(DataGridConfig config)
          Set a DataGridConfig instance used to create a DataGridState object.
 void setGridName(String name)
          Set the data grid name whose DataGridState should be placed in the JspContext.
 void setVar(String var)
          Set the name used to store the DataGridState object as a JspContext attribute.
 
Methods inherited from class AbstractSimpleTag
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetDataGridState

public GetDataGridState()
Method Detail

getTagName

public final String getTagName()
The name of this tag; this value is used for error reporting.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractSimpleTag
Returns:
the String name of this tag

setGridName

public void setGridName(String name)
Set the data grid name whose DataGridState should be placed in the JspContext.

Parameters:
name - the name of the data grid

setVar

public void setVar(String var)
Set the name used to store the DataGridState object as a JspContext attribute.

Parameters:
var - the name used to store the DataGridState

setDataGridConfig

public void setDataGridConfig(DataGridConfig config)
Set a DataGridConfig instance used to create a DataGridState object. This attribute is optional; when unset, the default DataGridConfig is used.

Parameters:
config - the DataGridConfig used to create the DataGridState

doTag

public void doTag()
Using a DataGridConfig object, access the DataGridState and place it in the JspContext under the attribute key set via setVar(String)

Specified by:
doTag in interface SimpleTag
Overrides:
doTag in class SimpleTagSupport