[Seaside] tables

Nevin Pratt nevin at smalltalkpro.com
Sat Mar 22 12:44:24 CET 2003



Avi Bryant wrote:

>  
>
>>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.
>>    
>>
>
>Yes, although I can see specifying all those points getting tedious (and
>not very maintainable - what if you need to insert a row?).
>  
>

I'm confused.  If the code like the above is in the #renderContentOn:, 
then the table is recreated with each rendering.  Thus, *every* row is a 
new row, every time.

>In the back of my head, I wonder if somehow moving to a DOM-based renderer
>in 2.3 will smooth some of those integration issues
>

I've wondered this as well.

>Of course, if you were really only planning on "rich text" in the cells
>(and not, for example, form inputs), that would make things easier.  But:
>
>  
>
>>And, of course, elements other than rich text could also be put into any
>>cell as well.
>>    
>>
>
>In this case I'd recommend you at least think about using #renderOn:
>rather than #asHtml.
>
>  
>

I think you are right.

Also, even though I am sort of recoiling at the complexity of a lowly 
table, I'm starting to wonder (again) if you don't already have a rather 
good compromise between complexity and flexibility in the existing code. 
 As I say this, I am again thinking of your #labelledRowFor... suite of 
messages, as well as your #tableRowWith... suite of messages.

Nevin
 




More information about the Seaside mailing list