M5 Release
From ExtremeComponents
Development Snapshot Release
This is the latest Development Snapshot Release (download). This build represents the code for the next release.
1.0.1-M5-A4
I decided to do another milestone release because I made some
adjustments to the view code, and the eXtremeTable is now going to be
AJAX enabled (not part of build yet). These are big enough features
that I would really like to work perfectly before the release candidate.
The following features and enhancements represent the next
milestone build of the eXtremeTable. I was hoping to not have any
breakage going from the last milestone to this milestone. However,
after working through the implementation of the M4 view code I decided
I had to make one final change...going from static builders to concrete
classes. This will be the only breakage and only effects those with
custom views (custom cells too, but more gracefully deprecated). Even
then the changes can be easily implemented.
Html Builder classes are concrete now.
All the view builder classes are concrete and need to be
instantiated. This only effects developers that have created custom
views or custom cells. This was a much needed change to make the view
code as flexible as it needs to be. Having the builder classes be
static worked Ok, but there would be no opportunities to do anything
interesting in the future, and made creating custom views more
difficult. However, the methods are all the same yet and just requires
a builder class to be instantiated with an HtmlBuilder.
To make the transition easier the CellBuilder is still static,
but is now deprecated. The new (non-static) builder is called the
ColumnBuilder, which actually makes more sense as that is what is being
built.
public String getHtmlDisplay(TableModel model, Column column) {
ColumnBuilder columnBuilder = new ColumnBuilder(column);
columnBuilder.tdStart();
columnBuilder.tdBody(getCellValue(model, column));
columnBuilder.tdEnd();
return columnBuilder.toString();
}
As another example, now that the ColumnBuilder is not static I would write custom cells more like this:
public String getHtmlDisplay(TableModel model, Column column) {
InputBuilder inputBuilder = new InputBuilder(column);
inputBuilder.tdStart();
try {
Object bean = model.getCurrentRowBean();
Integer id = new Integer(BeanUtils.getProperty(bean, "id"));
inputBuilder.tdBody(id);
} catch (Exception e) {}
inputBuilder.tdEnd();
return inputBuilder.toString();
}
private static class InputBuilder extends ColumnBuilder {
public InputBuilder(Column column) {
super(column);
}
public void tdBody(Integer id) {
getHtmlBuilder().input("radio").name("location.id").id("location.id").value(id.toString()).onclick("populateLocationFields(this.value)");
getHtmlBuilder().xclose();
}
}
}
It is much cleaner to just extend the builder you care about and then build your custom implmentation.
In addition the toolbar code has been completely refactored, but
the implemenation was hidden behind the ToolbarBuilder class and so no
one should be effected by the changes.
Lastly, I am exploring creating a named toolbar feature that
would enable different toolbars to be referenced in the preferences and
on the table. The feature would use reflection to dynamically build the
toolbar. This would enable a developer to easily define a custom
toolbar through the preferences. For example a toolbar could be defined
to not include the last page for the Limit, or another toolbar that
does not include the rows displayed...things like that. If this is the
only reason you have a custom view you are better off waiting a week or
two until I get this done, unless you need one of the new features.
New Table showTitle attribute.
New TableTag showTitle attribute is used to specify whether or not
to show the title. This is a boolean value with the default being true.
Limit can now use the State feature.
To use the State feature with the Limit feature you need to use the
TableLimitFactory constructor that accepts the state. When using the
state feature you should always give a unique tableId (in this example
called presidents) so the constructor with the state will require the
tableId also.
Context context = new HttpServletRequestContext(request);
LimitFactory limitFactory = new TableLimitFactory(context, presidents, TableConstants.STATE_PERSIST, null);
Limit limit = new TableLimit(limitFactory);
New Column filterOptions attribute / FilterOption interface.
New ColumnTag filterOptions attribute. Accepts a Collection of
filter options where each bean in the Collection implements the
FilterOption interface. Is used in conjunction with the
filterCell=droplist. Very useful when using the Limit to use a custom
droplist.
New Export encoding attribute / XlsView has Locale support.
By default the XlsView uses UTF-16 character encoding. If you need
to use unicode then use the new ExportTag encoding attribute. The
acceptable values are UTF and UNICODE.
Removed the style attribute from the Compact View title.
This was kind of bug in the view code as I hard coded the title of
the table when using the compact view. Just style (or move) the title
through the CSS titleRow attribute.
TableModel is an Interface now.
The TableModel is now an interface. This does not impact any code
except the TableAssembler. However, as mentioned below, assembling a
table with just Java code is even easier now.
TableAssembler is integrated into the TableModel.
When building an eXtremeTable in Java code in the last release you
would use the TableAssembler class. That code was refactored and
completely integrated into the TableModel. This makes the feature even
easier to use than before.
TableModel model = new TableModelImpl(context);
Table table = new Table(model);
table.setItems(presidents);
table.setAction("assembler.run");
table.setTitle("Presidents");
table.setShowTooltips(Boolean.FALSE);
model.addTable(table);
Row row = new Row(model);
row.setHighlightRow(Boolean.FALSE);
model.addRow(row);
Column columnName = new Column(model);
columnName.setProperty("fullName");
columnName.setIntercept((AssemblerIntercept.class).getName());
model.addColumn(columnName);
Column columnNickName = new Column(model);
columnNickName.setProperty("nickName");
model.addColumn(columnNickName);
Object view = model.assemble();
Renamed FilterSet.getValue() method.
Deprecated the poorly named FilterSet.getValue() method and renamed it to FilterSet.getFilterValue().
Remove TableTag onsubmit.
The onsubmit was removed as it was never being called because javascript is used for all the table actions.
Export Totaling
The PDF and XLS exports now include totaling capability. There is nothing you need to do except use the Calc feature as normal.
Export Errors - Response Headers Change
The filter response headers should handle exporting in different environments better. Add the following to the response headers:
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
ColumnsTag autoGenerateColumns Preferences
The tag attributes that are backed by an interface have the ability
to alias out the attribute to avoid having to give the fully qualified
package name. The ColumnsTag autoGenerateColumns attribute now includes
this feature.
Automatically Convert Parameters
Greatly improved the Registry to accept either a null, String, List
or Array as a parameter. The Registry will convert it to a String[] for
you.
TableTag bufferView attribute
TableTag bufferView attribute. The default is true to buffer the
view by default. This will improve the performance of the tag rendering
in that the html view is streamed right out to the response writer if
the bufferView is set to false. This does in theory improve the
performance but I only included the feature because I thought it would
be a nice feature. In general the eXtremeTable is very streamlined and
this is just an additional performance kick.
AJAX enable the eXtremeTable
When creating a table with Java code using the eXtremeTable API it
is now possible to combine AJAX technology to render the view. For
those new to AJAX this means that the web page does not have to refresh
to navigate the eXtremeTable! This is very exciting and more
documentation will be coming out soon so that developers can start
testing and using this feature. The only real hook to use this feature
is to use the new Table onInvokeAction attribute to give the javascript
method that should be invoked. One of the most powerful aspects of the
AJAX integration is there is no integration. The eXtremeTable has a
very clear and easy API to use and so this was the logical next step.
This also means you can use your favorite AJAX technology as the
eXtremeTable does not actually integrate with any specific one. There
is an example in the site code that is only checked into CVS right now.
However, my site runs on HSQL now so anyone can check out the source
code and run the example. Please do not ask for more documentation at
this time as I will be working to pull some together and will have it
available soon!
0