We are proud to release version 3.0 of our Table bean. Version 3 is a major rewrite of the rendering and editing possibilities of the bean.
As shown in the screenshot below, a single cell can contain almost anything that was only possible on a per column base before:
To enable this new functionality, we have introduced a CellFormat object. A CellFormat offers many formatting properties such as
- text alignment, color and font
- background color
- cell border
- editable property
CellFormats also allow to control the renderer and editor of a cell:
- normal text
- text areas
- dates
- numbers
- checkbox
- combobox
- value list
CellFormats can be applied to rows, columns or single cells. To ease handling, CellFormats can be named and reused. Here is a small code example on how to use a CellFormat (a more complex example can be found in the sample solution):
var vMyFormat = elements.tablebean.createCellFormat(‘myFormat’;
vMyFormat.alignment = 2;
vMyFormat.font = ‘Tahoma,1,11’;
vMyFormat.border = ‘LineBorder,1,#efefef’;
elements.tablebean.setFormatForCell(1,1,vMyFormat);
Among the many other new features of the Table bean are the following:
- lazy loading foundsets: instead of loading all records from a foundset into memory, a foundsetGrid can be made “lazy loading”. That means, that only 200 records at a time are loaded. Whenever the user scrolls down, another 200 are loaded etc. One important implication of that is that sorting has to be done by the database, so a lazy loading foundset cannot be sorted on unstored calculations. Please not that lazy loading foundsets do not work in Servoy 5.0.0, but any other version.
- support for display and editing formats for date and number cells: just like a Servoy field, the table bean now accepts formats in a displayFormat|editingFormat syntax.
- incorrect entries in number and date fields are displayed in red
- value list fields are no longer read only: if you set a value list on a field, not combobox will be shown. If the user starts editing such a field, then a combobox editor will be presented.
- support for methods instead of calculations for background color, foreground color and font in a foundsetGrid (please note that in Servoy 5 only methods are supported and calculations will no longer work)
- support for Servoy border style strings: border styles can be copied from a form property and assigned to the bean (e.g. ‘LineBorder,1,#000000’)
Please note that Table bean 3.0 is (our first ever) paid update, so it requires a new license key. Update licenses can be obtained from our shop.