[aida] To div or not

Janko Mivšek janko.mivsek at eranova.si
Thu Jan 29 19:20:54 CET 2009


Michael Rueger pravi:
> Eli Green wrote:
> 
>> I would say that you should use DIV when you can: header, footer,
>> menus, main content, etc. On the other hand, the act of laying out
>> forms nicely without the use of tables has always seemed to me to be
>> an exercise in masochism. So the exception to the above rule for me
>> has always been forms with pairs of labels/input widgets. If somebody
>> is willing to correct me, I will eat my words.
> 
> would be an interesting feature to allow the programmer to layout the 
> page (web components/elements) in a table (layout) in AIDA, but then 
> have the appropriate combination of DIVs and CSS entries generated for 
> the client.

And yet another possibility would be to extend a div support as we have
for tables, and which simplicity is responsible to quite a degree for a
table overuse in Aida.

Table example:

	e cell cell addText: c1. e cell newCell addText: c2;
	e cell newRow.
	e cell cell addText: c3 e cell newCell addText: c4;

Here we have a table nested into another table. This is a hell hard to
do the traditional way with WebTableRows, WebTableCells.

Pretty similar problem we have with DIVs. Look for instance this code
from the new Aida site:

  e := WebElement newClass: #'primary-content'.
  e add: ((WebElement newClass: #'info-a')
       add: ((WebElement newClass: #'wrap-info-1a') "top part"
          add: ((WebElement newClass: #'wrap-info-2a')
             add: self downloadScriblet;
             add: self sloganScriblet; yourself);
          yourself);
       yourself).

Complicated and ugly as a hell. So I already started to think to
introduce div support into WebElements:

  e := WebElement new.
  e div class:#'primary-content'.
  e div div class: #'info-a'.
  e div div div class: #'wrap-info-1a')
  e div div div div class: #'wrap-info-2a'
       add: self downloadScriblet;
       add: self sloganScriblet.
  e newDiv.
  e div class: ..
  e div div class: ...

etc.

What do you think, idea any good?
Janko

-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si



More information about the Aida mailing list