[Seaside] tables
Nevin Pratt
nevin at smalltalkpro.com
Sat Mar 22 11:57:02 CET 2003
Avi Bryant wrote:
>
>
>I would write this as
>
>...html bold: 'this is a test'.
>
>
>
>
This is a version 2.3 feature, and I'm not running 2.3. I felt I should
try to understand the framework better before moving to the bleeding
edge :-)
I've been thinking about a simplified scheme based on Cees'
TableGenerator approach. Each cell of the 2-dimensional matrix (i.e, of
the table) would have the equivalent of "Rich Text", where the text
itself would know about it's own font, size, and style. You create and
add table elements thus:
table := HtmlTableGenerator new.
table put: myRichText inCell: aPoint.
The 'inCell:' argument is a point specifying the cell of the matrix
(i.e., the row and the column) to add the rich text to. The table would
look at this argument as it came in, and keep track of the current
number of rows and columns in the table. There would be no need to
explicitly specify how many rows or columns, as it could figure it out
on its own, based on what it sees in this argument at runtime.
I would have a number of attribute methods for the cells like thus:
table alignCenterForCell: aPoint.
table alignLeftForCell: aPoint.
...etc...
The table itself would also have a number of attribute methods like thus:
table alignCenter.
table alignLeft.
table alignRight.
...etc...
Then the table could be asked to generate html for it's current
configuration and contents thus:
table asHtml.
The rich text within any given cell would be recursively asked by the
table for it's html representation in the same way, and that's how the
various <font> tags (and attributes) would get generated.
And, of course, elements other than rich text could also be put into any
cell as well.
Nevin
More information about the Seaside
mailing list