You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/01/30 16:54:44 UTC
svn commit: r373536 -
/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml
Author: ekoneil
Date: Mon Jan 30 07:54:41 2006
New Revision: 373536
URL: http://svn.apache.org/viewcvs?rev=373536&view=rev
Log:
Add a bit more info about how the data grid relates to the sorts / filters.
BB: self
Test: build.release.docs pass
Modified:
beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml
Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml?rev=373536&r1=373535&r2=373536&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/tags/datagridSortAndFilter.xml Mon Jan 30 07:54:41 2006
@@ -17,6 +17,16 @@
query string in a specific query language like SQL, XQuery, EJB-QL, and so on.
</p>
<p>
+ The data grid is related to sorting and filtering, but the data grid itself does not actually sort or filter a data set. While
+ this feature could be supported in the future, the goal of sorts and filters are to support loose coupling of the process used
+ to sort and filter while allowing the data grid to track the states of sorts and filters. The data grid supports sorts and
+ filters through setting CSS class names on columns that are sorted and filtered and by supporting UI gestures -- such as clicking
+ on a column header -- to sort and filter data. Because the sort and filter information is exposed from the
+ <a href="../apidocs/javadoc/org/apache/beehive/netui/databinding/datagrid/api/DataGridState.html">DataGridState</a> object,
+ the JSP 2.0 expression language can be used to configure the user interface based on the sort, filter, and paged state
+ of a data set displayed in a data grid.
+ </p>
+ <p>
This document describes the structure of sort and filter objects and discusses how they can be created, used to sort a data set,
and how they relate to the data grid. A concrete example that demonstrates some of the sort and filter features can be found
in a Beehive sample available in <em>samples/netui-samples/web/ui/datagrid/sortandfilter</em>. This sample demonstrates the
@@ -34,7 +44,7 @@
Sort</a> class which has several properties:
</p>
<table>
- <tr><td>Property Name</td><td>Description</td></tr>
+ <tr><td><strong>Property Name</strong></td><td><strong>Description</strong></td></tr>
<tr>
<td>sortExpression</td>
<td>The sort expression is a String that describes the data to be sorted.</td>
@@ -62,9 +72,7 @@
this will cycle the sorted state through a series of states from NONE to ASCENDING to DESCENDING. The change in state
can be observed by watching the URL. By default, a sort appears in the URL as:
</p>
- <source>
-netui_sort=<namespace>;(|-)<sortExpression>
- </source>
+ <source>netui_sort=<namespace>;(|-)<sortExpression></source>
<p>
The namespace is taken from the data grid's <a href="../apidocs/javadoc/org/apache/beehive/netui/databinding/tags/datagrid/DataGrid.html#setName()">name</a>
attribute in order to scope a sort to a particular data grid.
@@ -77,10 +85,8 @@
object that parses state information from a query string and can return the list of states. This can be done using the following
code:
</p>
- <source>
-DataGridState dataGridState = DataGridStateFactory.getInstance(httpServletRequest).getDataGridState("<namespace>");
-List sorts = dataGridState.getSortModel().getSorts();
- </source>
+ <source>DataGridState dataGridState = DataGridStateFactory.getInstance(httpServletRequest).getDataGridState("<namespace>");
+List sorts = dataGridState.getSortModel().getSorts();</source>
<p>
Although the data grid may use a sort expression, the data will not be sorted until code executes to actually sort the data.
<em>The data grid does not automatically sort data</em>. In order to sort data, controller code must be implemented to
@@ -102,10 +108,8 @@
can be used for this purpose. A sort of the form <em>netui_sort=customers;-customerid</em> will be converted into a
SQL fragment of the form <code>ORDER BY customerid DESC</code> using the code:
</p>
- <source>
-List sorts = dataGridState.getSortModel().getSorts();
-String sort = SQLSupport.getInstance().createOrderByClause(sorts);
- </source>
+ <source>List sorts = dataGridState.getSortModel().getSorts();
+String sort = SQLSupport.getInstance().createOrderByClause(sorts);</source>
<p>
A list of Sort(s) can also be used to manually filter a data set, particularly when sorting on a single sort expression (column
of data). In this case, a reasonably sized data set can be sorted in-memory quickly using a custom <code>Comparator</code>
@@ -140,7 +144,7 @@
JavaBea which has several properties:
</p>
<table>
- <tr><td>Property Name</td><td>Description</td></tr>
+ <tr><td><strong>Property Name</strong></td><td><strong>Description</strong></td></tr>
<tr>
<td>filterExpression</td>
<td>The filter expression is a String that describes a property from the data set to filter.</td>
@@ -206,9 +210,7 @@
to a query string as query parameters is that a filtered data grid can be bookmarked, which can make it easy to return to
a specific view into a data set. The default format for filters in the URL is:
</p>
- <source>
-netui_filter=<namespace>;<filterExpression>~<filterOperation>~<value>
- </source>
+ <source>netui_filter=<namespace>;<filterExpression>~<filterOperation>~<value></source>
<p>
The namespace of the filter is taken from the data grid's
<a href="../apidocs/javadoc/org/apache/beehive/netui/databinding/tags/datagrid/DataGrid.html#setName()">name</a> attribute, and
@@ -218,10 +220,8 @@
which is used to manage a grid's state from some state source. The filters can be extracted from the query string using the
following code:
</p>
- <source>
-DataGridState dataGridState = DataGridStateFactory.getInstance(httpServletRequest).getDataGridState("<namespace>");
-List filters = dataGridState.getFilterModel().getFilters();
- </source>
+ <source>DataGridState dataGridState = DataGridStateFactory.getInstance(httpServletRequest).getDataGridState("<namespace>");
+List filters = dataGridState.getFilterModel().getFilters();</source>
<p>
Filters can be placed on the URL by JavaScript in the page or by extending the data grid itself to support filtering.
</p>
@@ -252,8 +252,7 @@
A query engine can be used by converting a set of Filter objects into a fragment of a query string. For example, a filter can be configured
and converted into a SQL <code>WHERE</code> clause <code>WHERE companyname LIKE '%wheel%'</code> using the following code:
</p>
- <source>
- // create the DataGridConfig object for a grid
+ <source>// create the DataGridConfig object for a grid
DataGridConfig dataGridConfig = DataGridConfigFactory.getInstance();
// configure the filter