Doco Home Hints Home
Platypus Hints: Features
Striped tables
Often you display a set of
records in a table, one record per row. When displaying multiple records
like this, giving alternating colours to the rows makes it easier to read
the table.
The Timesheet tutorial app demonstrates
this feature in the AddOneItemForm, EditWorkItemsForm, EditWorkItemsResults,
EditPersonList and ReportPeriodResults pages.
This is implemented as follows:
- Assumptions
- We assume the records will be displayed in a table, one row per
record, and the template TR tag has an ID attribute.
- Required in HTML
- ID attribute in TR tag indicating non-unique access.
Stylesheet must have LINE1 and LINE2 styles, with different background colours.
- Required in config
- The ACCESS section needs a STRIPED = TRUE field.
This is generated by ConfigGen. If you don't want this
feature, remove the STRIPED field, or set it to FALSE.
- Required in presentation layer Java
- Call to
ProdUtil.setClassAttributeModulo( access template node, row index )
.
- Required in business layer Java
- Nothing.
Subheaders in tables
Often, you want to break the set of records in a non-unique access into
groups, with a subheader or "subfooter" at the top or bottom of each group.
The Timesheet tutorial app demonstrates subheaders in the
EditWorkItemsForm, EditWorkItemsResults and ReportPeriodResults pages.
This is implemented as follows:
- Assumptions
- We assume the records will be displayed in a table, one row per
record, and the template TR tag has an ID attribute.
Here, we describe having a subheader at the top of each
group. Having a subfooter at the bottom of each group can be
implemented analagously.
- Required in HTML
- An ID-attributed template TR tag for the sub-header.
- Required in config
- The dynamic nodes in the subheader must have an ACCESS field, with the
same value as the IDs in the normal record template.
The subheader's ID section must have an ALWAYSIN = TR field.
The subheader should not have a separate ACCESS section.
The subheader's ID section should have a DATAFROM = DATABASE field (but
probably no FIELDPATH field).
- Required in presentation layer Java
- A conditional block of code to optionally insert the subheader clone in
the served DOM. This is mostly generated by Pond, but needs to be
tweaked by hand.
- Required in business layer Java
- The business layer Java needs to compute both the test for inclusion of
the subheader, and the values required in the subheader's dynamic
nodes. These are (probably) all accessed via the
getIdValue( int
recordIndex, String idValue )
method.