Forum OpenACS Development: Q-Forms now has a table display proc to simplify standard table UI features

Howdy devs,

Q-forms has just been updated (version 440) with a new feature that simplifies displaying sortable table data in html using a tcl proc.

The styles are meant to integrate with existing OpenACS templating seemlessly.

The links for the UI and sort features are automatically built and configurable. Existing localization keys are used for consistency.

CSS and html attributes are editable by changing parameter defaults.

Sorts by integer, real, dictionary, and ascii in either ascending or descending, with fallback to ascii if there's a sort error. Developer may choose type and which columns to allow to be sorted by user. The UI provides an intuitive way for the user to know which columns are sorted and in which order (increasing/decreasing) or not yet sorted just by looking at the column heading. The most significant sort column is automatically moved to the left, a second sorted column is second from left etc.

A scalable pagination feature is included, which works pretty well for tens of thousands of rows, allowing just a few clicks to get anywhere while only showing 10 options at a time. Two modes are provided, one for showing page numbers, and one for showing the first column's first value as a page index --kind of like a card catalog.

Here are two demo pages, taken from the doc section of the package:

https://or97.net/test-qfo_table_g2-b navigation using page numbers

https://or97.net/test-qfo_table_g2-a navigation using column indexes

(The CSS will look goofy on these, only because this site is not using the default OpenACS stylesheet).

The data in the demos are quasi-randomly generated with each page rendering. It is designed to show one column of each type of data with some persistence of randomization for a few minutes between columns and sort types, to help show the possibilities available on the fly.

Both pages consist of the same code. Here is a link to their adp/tcl components as text:
https://or97.net/test-qfo_table_g2-a.tcl.txt
https://or97.net/test-qfo_table_g2-a.adp.txt

Your suggestions on how to improve or make this more usable is most welcome. Or make the changes yourself in the OpenACS repo if you have access.

cheers,
Ben