Java Doc for DataGrid.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » databinding » datagrid » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.databinding.datagrid 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.beehive.netui.tags.databinding.datagrid.AbstractDataGridHtmlTag
   org.apache.beehive.netui.tags.databinding.datagrid.DataGrid

DataGrid
public class DataGrid extends AbstractDataGridHtmlTag implements IDataAccessProvider,IBehaviorConsumer,IHtmlCore,IHtmlEvents,IHtmlI18n(Code)

This tag is the containing tag for all tags and markup used to render a data grid. In its simplest form, a data grid is an HTML table containing an HTML table row for every item in a data set. The data grid also provides functionality for rendering the following major regions:

  • a header -- a header contains the top-most rows in a data grid's HTML table and is rendered using the Header tag
  • data rows -- markup rendered in the data grid for each record in the data set must be contained in a Rows tag
  • a footer -- a footer contains the bottom-most rows in a data grid's HTML table and is rendered using the Footer tag
  • caption -- an HTML table caption appears at the top of the table and is rendered using the Caption tag.
In addition, a data grid can also configure and render a pager using the ConfigurePager and RenderPager tags respectively.

Inside of the Header and Rows rendering regions, the data grid renders HTML table cells. The data grid tag set provides a set of tags that can be used render these cells with varying content including:

  • HTML <th> cells -- these are generally used inside the Header
  • anchors -- these can be rendered using the AnchorCell tag
  • images -- these can be rendered using the ImageCell tag
  • image anchors-- these can be rendered using the ImageAnchorCell tag
  • HTML spans -- these can be rendered using the SpanCell tag
The TemplateCell tag can be used as a container for arbitrary content that may be included in a cell's contents. The Footer tag's content can also use these tags.

When the data grid renders its data set, the container JSP EL implicit object is exposed in the JSP's JspContext and can be referenced using the ${contaimer} JSP EL expression. The current item of data from the data set can be referenced using the ${container.item} expression. If the item had a name property, it could be referenced as ${container.item.name}. By default, the data grid renders a paged data set which will only display a portion of the complete data set. The default page size is PagerModel.DEFAULT_PAGE_SIZE and can be changed by setting the ConfigurePager.setPageSize(int) attribute.

In addition to rendering a data grid, this tag set cooperates with a set of state management services exposed via the org.apache.beehive.netui.databinding.datagrid.api.DataGridStateFactory . These services help to manage state related to paging, sorting, and filtering. For example, the first row displayed in the grid's current page and the sorts for a particular column of data are can be read / written using these state objects. The data grid will use various state information from these classes at reunder time. For example, when rendering a paged data set, the data grid will use the org.apache.beehive.netui.databinding.datagrid.api.DataGridStateFactory to obtain a PagerModel which can be used to determine the current org.apache.beehive.netui.databinding.datagrid.api.pager.PagerModel.getRow . The grid will then use this row value to advance the grid to the appropriate page to display.

By default, the data grid uses a configuration JavaBean which provides instances of state containers and services that are used to maintain state and render grid markup. This config object is a subclass of DataGridConfig and is obtained via the DataGridConfigFactory . The default implementation is org.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfig . Page authors may provide their own implementations of this object and set an instance via DataGrid.setDataGridConfig(org.apache.beehive.netui.databinding.datagrid.api.DataGridConfig) . This can be used to change default behaviors, change the appearance of the pager, and change the messages displayed during rendering among other things.

A simple, sortable, and pageable data grid that uses a first / previous // next / last pager might be written as:

 <netui-data:dataGrid dataSource="pageScope.zooAnimals">
 <netui-data:configurePager disableDefaultPager="true" pageAction="page" pagerFormat="firstPreviousNextLast"/>
 <netui-data:caption>
 <netui-data:renderPager/>
 <netui-data:caption>
 <netui-data:header>
 <netui-data:heaederCell value="Animal" sortExpression="animal"/>
 <netui-data:heaederCell value="Quantity" sortExpression="quantity"/>
 <netui-data:heaederCell value="Details"/>
 </netui-data:header>
 <netui-data:rows>
 <netui-data:spanCell value="${container.item.animalName}"/>
 <netui-data:spanCell value="${container.item.quantity}"/>
 <netui-data:anchorCell action="details" value="Details">
 <netui:parameter name="animalId" value="${container.item.animalId}"/>
 </netui-data:anchorCell>
 </netui-data:rows>
 </netui-data:dataGrid>
 
This data grid would render an HTML table with a <caption> that contains a first / previous // next / last formated pager. The data grid would display a page with ten data rows and three columns. The header contains the column titles with clickable sorting links for sorting by the animal name and quantity. The body of the data grid contains three cells per row containing two HTML <span> tags and an HTML anchor which will navigate to a Page Flow action caclled details when clicked.

HeaderRowsFooterCaptionConfigurePagerRenderPagerHeaderRowsHeaderAnchorCellImageCellImageAnchorCellSpanCellTemplateCellFooterJspContextPagerModel.DEFAULT_PAGE_SIZEConfigurePager.setPageSize(int)org.apache.beehive.netui.databinding.datagrid.api.DataGridStateFactoryorg.apache.beehive.netui.databinding.datagrid.api.DataGridStateFactoryPagerModelorg.apache.beehive.netui.databinding.datagrid.api.pager.PagerModel.getRowDataGridConfigDataGridConfigFactoryorg.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfigDataGrid.setDataGridConfig(org.apache.beehive.netui.databinding.datagrid.api.DataGridConfig)




Method Summary
public  voiddoTag()
    

Render a data grid.

public  intgetCurrentIndex()
     Get the index of the current item in the data set.
public  ObjectgetCurrentItem()
     Get the current item in the data set.
public  ObjectgetCurrentMetadata()
     Get metadata for the current item.
public  StringgetDataSource()
     Get the data source for the data grid.
public  IDataAccessProvidergetProviderParent()
     Get the parent data access provider.
public  StringgetTagName()
     The name of this tag; this value is used for error reporting.
public  voidsetBehavior(String name, Object value, String facet)
    

Implementation of the IBehaviorConsumer interface that extends the functionality of this tag beyond that exposed via the JSP tag attributes.

public  voidsetBorder(String border)
     Sets the border attribute for the HTML table tag.
public  voidsetCellpadding(String cellpadding)
     Sets the cellpadding attribute for the HTML table tag.
public  voidsetCellspacing(String cellspacing)
     Sets the cellspacing attribute for the HTML table tag.
public  voidsetDataGridConfig(DataGridConfig dataGridConfig)
    

Set the DataGridConfig instance that this tag will use to create state containers and other data grid objects used during rendering.

public  voidsetDataSource(String dataSource)
    

Set the data source that references a data set to be rendered by the data grid.

public  voidsetDir(String dir)
     Sets the dir attribute for the HTML table tag.
public  voidsetFrame(String frame)
     Sets the frame attribute for the HTML table tag.
public  voidsetLang(String lang)
     Sets the lang attribute for the HTML table tag.
public  voidsetName(String name)
     Set the name of this data grid.
public  voidsetOnClick(String onClick)
     Sets the onClick JavaScript event for the HTML table tag.
public  voidsetOnDblClick(String onDblClick)
     Sets the onDblClick JavaScript event for the HTML tag.
public  voidsetOnKeyDown(String onKeyDown)
     Sets the onKeyDown JavaScript event for the HTML tag.
public  voidsetOnKeyPress(String onKeyPress)
     Sets the onKeyPress JavaScript event for the HTML tag.
public  voidsetOnKeyUp(String onKeyUp)
     Sets the onKeyUp JavaScript event for the HTML tag.
public  voidsetOnMouseDown(String onMouseDown)
     Sets the onMouseDown JavaScript event for the HTML tag.
public  voidsetOnMouseMove(String onMouseMove)
     Sets the onMouseMove JavaScript event for the HTML tag.
public  voidsetOnMouseOut(String onMouseOut)
     Sets the onMouseOut JavaScript event for the HTML tag.
public  voidsetOnMouseOver(String onMouseOver)
     Sets the onMouseOver JavaScript event for the HTML tag.
public  voidsetOnMouseUp(String onMouseUp)
     Sets the onMouseUp JavaScript event for the HTML tag.
public  voidsetRenderRowGroups(boolean renderRowGroups)
    

Sets a boolean that enables / disables rendering of HTML table row groups in the data grid.

public  voidsetResourceBundlePath(String resourceBundlePath)
    

Set the resource bundle path used when getting messages from a DataGridResourceProvider during data grid rendering.

public  voidsetRules(String rules)
     Sets the rules attribute for the HTML table tag.
public  voidsetStyle(String style)
     Sets the style for the HTML table tag.
public  voidsetStyleClass(String styleClass)
     Sets the style class for the HTML table tag.
public  voidsetStyleClassPolicy(String stylePolicy)
    

Set the name of a CSS policy to use when rendering HTML elements in a data grid.

public  voidsetStyleClassPrefix(String styleClassPrefix)
    

Set the style class prefix used to namespace style class names rendered as attributes on HTML tags generated by the data grid.

public  voidsetSummary(String summary)
     Sets the summary attribute for the HTML table tag.
public  voidsetTagId(String tagId)
     Set the name of the tagId for the HTML table tag.
public  voidsetTitle(String title)
     Sets the value of the title attribute for the HTML table tag.
public  voidsetWidth(String width)
     Sets the width attribute for the HTML table tag.



Method Detail
doTag
public void doTag() throws JspException, IOException(Code)

Render a data grid. This method implements the logic used to iterate through the data grid's rendering states defined in DataGridTagModel .


throws:
  JspException - when an error occurs evaluating the tag's body
throws:
  IOException - when an error occurs writing to the output strema



getCurrentIndex
public int getCurrentIndex()(Code)
Get the index of the current item in the data set. This is a zero-based absolute index into the entire data set being rendered by the data grid. This value should only be data bound inside of the Rows . the index of the current item



getCurrentItem
public Object getCurrentItem()(Code)
Get the current item in the data set. As the data grid iterates over the data set, this value will change to provide access to the current item in the data set. This value should only be data bound inside of the Rows . the current item



getCurrentMetadata
public Object getCurrentMetadata()(Code)
Get metadata for the current item. This operation is unsupported on the data grid. the metadata for the current item
throws:
  UnsupportedOperationException - as this method is unsupported



getDataSource
public String getDataSource()(Code)
Get the data source for the data grid. This value returns a NetUI EL expression which can be evaluated by the NetUI tag API. the expression



getProviderParent
public IDataAccessProvider getProviderParent()(Code)
Get the parent data access provider. This method requires access to the tag hierarchy and is not usable across tag file or JSP include rendering boundaries. The result of this method is used for evaluating expressions of the form ${container.container} where this tag's parent repeating tag is referenced. the parent data access provider



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



setBehavior
public void setBehavior(String name, Object value, String facet) throws JspException(Code)

Implementation of the IBehaviorConsumer interface that extends the functionality of this tag beyond that exposed via the JSP tag attributes. This method accepts the following facets:
Facet NameOperation
resourceAdds or overrides a data grid resource key with a new value.
A new resource key is added in order to override a value defined in org.apache.beehive.netui.databinding.datagrid.api.rendering.IDataGridMessageKeys . When a message is overridden or added here, the page author is able to override a single string resource such as a pager mesage or sort href.


Parameters:
  name - the name of the behavior
Parameters:
  value - the value of the behavior
Parameters:
  facet - th ebehavior's facet
throws:
  JspException - when the behavior's facet isnot recognized



setBorder
public void setBorder(String border)(Code)
Sets the border attribute for the HTML table tag.
Parameters:
  border -



setCellpadding
public void setCellpadding(String cellpadding)(Code)
Sets the cellpadding attribute for the HTML table tag.
Parameters:
  cellpadding - the cell padding



setCellspacing
public void setCellspacing(String cellspacing)(Code)
Sets the cellspacing attribute for the HTML table tag.
Parameters:
  cellspacing - the cell spacing



setDataGridConfig
public void setDataGridConfig(DataGridConfig dataGridConfig)(Code)

Set the DataGridConfig instance that this tag will use to create state containers and other data grid objects used during rendering. Custom implementations of this class can be provided that will override the defaults set in the org.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfig .

DataGridConfigorg.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfig



setDataSource
public void setDataSource(String dataSource)(Code)

Set the data source that references a data set to be rendered by the data grid. The data source should be a NetUI EL expression and generally looks like a JSP EL expression without the '${' and '}' characters. For example, to reference an array of Employee objects exposed via a NetUI page input, the expression might look like:

 <netui-data:dataGrid dataSource="pageInput.employeeArray" name="employeeGrid">
 
This expression will be evaluated the data grid in order to obtain a reference to the data set.




setDir
public void setDir(String dir)(Code)
Sets the dir attribute for the HTML table tag.
Parameters:
  dir - the dir



setFrame
public void setFrame(String frame)(Code)
Sets the frame attribute for the HTML table tag.
Parameters:
  frame - the frame



setLang
public void setLang(String lang)(Code)
Sets the lang attribute for the HTML table tag.
Parameters:
  lang - the lang



setName
public void setName(String name)(Code)
Set the name of this data grid. The name should be a simple String that is used to uniquely identify a data grid inside of a JSP. This value is also used to namespace state information in the URL that is scoped to a data grid. Within a given scope in a page, the page author is responsible for ensuring that this name is unique.



setOnClick
public void setOnClick(String onClick)(Code)
Sets the onClick JavaScript event for the HTML table tag.
Parameters:
  onClick - the onClick event.



setOnDblClick
public void setOnDblClick(String onDblClick)(Code)
Sets the onDblClick JavaScript event for the HTML tag.
Parameters:
  onDblClick - the onDblClick event.



setOnKeyDown
public void setOnKeyDown(String onKeyDown)(Code)
Sets the onKeyDown JavaScript event for the HTML tag.
Parameters:
  onKeyDown - the onKeyDown event.



setOnKeyPress
public void setOnKeyPress(String onKeyPress)(Code)
Sets the onKeyPress JavaScript event for the HTML tag.
Parameters:
  onKeyPress - the onKeyPress event.



setOnKeyUp
public void setOnKeyUp(String onKeyUp)(Code)
Sets the onKeyUp JavaScript event for the HTML tag.
Parameters:
  onKeyUp - the onKeyUp event.



setOnMouseDown
public void setOnMouseDown(String onMouseDown)(Code)
Sets the onMouseDown JavaScript event for the HTML tag.
Parameters:
  onMouseDown - the onMouseDown event.



setOnMouseMove
public void setOnMouseMove(String onMouseMove)(Code)
Sets the onMouseMove JavaScript event for the HTML tag.
Parameters:
  onMouseMove - the onMouseMove event.



setOnMouseOut
public void setOnMouseOut(String onMouseOut)(Code)
Sets the onMouseOut JavaScript event for the HTML tag.
Parameters:
  onMouseOut - the onMouseOut event.



setOnMouseOver
public void setOnMouseOver(String onMouseOver)(Code)
Sets the onMouseOver JavaScript event for the HTML tag.
Parameters:
  onMouseOver - the onMouseOver event.



setOnMouseUp
public void setOnMouseUp(String onMouseUp)(Code)
Sets the onMouseUp JavaScript event for the HTML tag.
Parameters:
  onMouseUp - the onMouseUp event.



setRenderRowGroups
public void setRenderRowGroups(boolean renderRowGroups)(Code)

Sets a boolean that enables / disables rendering of HTML table row groups in the data grid. When row group rendering is enabled, the data grid tags will produce the thead, tbody, and tfoot HTML tags via the Header , Rows , and Footer tags respectively. In addition, as per the HTML specification, the data grid will reorder the output of the row groups to in order to produce valid HTML. When row group rendering is enabled and a page is using JavaScript, the data grid must be nested inside of a NetUI org.apache.beehive.netui.tags.javascript.ScriptContainer in order for JavaScript rendering to be ordered correctly. Legacy JavaScript script mode is not supported by the data grid.

HeaderRowsFooterorg.apache.beehive.netui.tags.javascript.ScriptContainer



setResourceBundlePath
public void setResourceBundlePath(String resourceBundlePath)(Code)

Set the resource bundle path used when getting messages from a DataGridResourceProvider during data grid rendering. The resource bundle provided here will entirely override messages obtained from the DataGridResourceProvider and must include all message keys that are used for rendering. In order to replace individual messages, use the behavior available from the DataGrid.setBehavior(String,Object,String) method.

DataGridResourceProviderDataGridResourceProviderDataGrid.setBehavior(String,Object,String)



setRules
public void setRules(String rules)(Code)
Sets the rules attribute for the HTML table tag.
Parameters:
  rules - the rules



setStyle
public void setStyle(String style)(Code)
Sets the style for the HTML table tag.
Parameters:
  style - the html style.



setStyleClass
public void setStyleClass(String styleClass)(Code)
Sets the style class for the HTML table tag.
Parameters:
  styleClass - the html style class.



setStyleClassPolicy
public void setStyleClassPolicy(String stylePolicy)(Code)

Set the name of a CSS policy to use when rendering HTML elements in a data grid. The data grid supports the default style policy names defined here org.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfig.getStyleModel(StringString) .

org.apache.beehive.netui.databinding.datagrid.runtime.config.DefaultDataGridConfig.getStyleModel(StringString)



setStyleClassPrefix
public void setStyleClassPrefix(String styleClassPrefix)(Code)

Set the style class prefix used to namespace style class names rendered as attributes on HTML tags generated by the data grid. For example, when using the default style policy without setting this attribute, the style rendered for the generated HTML table tag will be:

 <table class="datagrid">
 
With the style class prefix of foo, the rendered HTML style class will be:
 <table class="foo">
 




setSummary
public void setSummary(String summary)(Code)
Sets the summary attribute for the HTML table tag.
Parameters:
  summary - the summary



setTagId
public void setTagId(String tagId) throws JspException(Code)
Set the name of the tagId for the HTML table tag.
Parameters:
  tagId - the the name of the tagId for the table tag.



setTitle
public void setTitle(String title)(Code)
Sets the value of the title attribute for the HTML table tag.
Parameters:
  title - the title



setWidth
public void setWidth(String width)(Code)
Sets the width attribute for the HTML table tag.
Parameters:
  width - the width



Methods inherited from org.apache.beehive.netui.tags.databinding.datagrid.AbstractDataGridHtmlTag
final protected void applyIndexedTagId(AbstractHtmlState state, String tagId) throws JspException(Code)(Java Doc)
final protected void applyTagId(AbstractHtmlState state, String tagId) throws JspException(Code)(Java Doc)
final protected DataGridTagModel lookupDataGridTagModel()(Code)(Java Doc)
protected String renderDefaultNameAndId(HttpServletRequest request, AbstractHtmlState state, String id, String name)(Code)(Java Doc)
final protected String renderNameAndId(HttpServletRequest request, AbstractHtmlState state, Form parentForm)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.