Kevin,

I thing widget is a good place for every html fragment (for edition and not), 
because :
* avoid copy paste (and synchronisation) if you have several place in your web site where you require same or similar display
* provide a simple way to share display feature across projects, and simple :
  * developer A create a cool set of widgets
  * developer A package widget as egg
  * developer B install the egg
  * create python code to initialise the widget, adapt the model (value or 
input_value)
* and in the template only need to write a "widget.insert(data)" without mess about CSS, JS and all HTML Tag and attributes.

Every Widget don't target Edition feature, (existing Resource and children, 
Grid)

Regards

Kevin Dangoor a écrit :
On 1/15/06, Mike Kent <[EMAIL PROTECTED]> wrote:

After thinking about it a bit, I decided that what I really wanted was
a Table widget, containing TableRow widgets, containing TableCell
widgets.  Since no such widgets exists, I wanted to take a crack at
writing them.  The TableForm widget is a container for other widget, so
it seems to be a good place to start.  Unfortunately, after studying
its source code for a while, I'm not getting anywhere; it's pretty
dense and sparsly-documented.


Generally, the big problem that widgets are out to solve is form
input/output. Unless you're trying to take advantage of the
JavaScript/CSS inclusion features of widgets, I'd stick with Kid
(maybe using py:defs) to generate a table.

Beyond that, how you design a widget like this really depends on how
you want to hand in the data. Generally speaking, widgets are designed
to be stateless (they can have multiple requests going through them at
the same time). This design actually helps in this case. You can
create a table widget that takes TableRow and TableCell widgets in the
constructor. Then, you pass a 2D array (or whatever) in to insert() or
render() and your Table widget will pass each value in turn to the
TableRow which then passes the individual values to the TableCell. It
should work fine, it's just not what I generally had in mind for
widgets.

Kevin


Has anyone else already taken a crack at a general-purpose table
widget?  Can anyone give me some instruction on how to write a
container widget of this type?

Thanks,
Mike





--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com


--
--------------------------------------------------------------
David "Dwayne" Bernard            Freelance Developer
                                  mailto:[EMAIL PROTECTED]
      \|/                         http://dwayne.java-fan.com
--o0O @.@ O0o-------------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to