cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: CForms :Advise on a new widget structure before going further
Date Sat, 02 Oct 2004 18:54:05 GMT
oceatoon wrote:

>I rather ask some advice before moving on.
>I am reading through all the existent post and wiki's about creating new
>widgets, also looked through Tim's GUI New, Class, Union, Struct way of
>doing things, to try and sort out a way of creating a widget that maps on
>an extenal selection list, and where every generated "input" or widget
>would be connected a text area. 
>(For example, having checkbox | label | text, as many times as I have items
>in the selection list)
>I can only see a general view but have trouble deciding which way to go, I'd
>really appreciate some guidance. 
>could be for example, 
>a repeater , which maps on a selection list, so I would have to implement
>this, is it a possibility?

IMO, a repeater is really the way to go. Writing a new kind of widget is 
needed only for new ways of handling data or form structure.

For the binding, there are two features that provide a solution for 
unusual scenarios which, for containers, seems to be more frequent than 
"regular" ones :-)

These are:
- the javascript binding, where you can do whatever you want with the 
widget and bound data. Back in june (after 2.1.5), I added a 
<fb:child-bindings> to the js binding to allow the container structure 
to be handled by the js code and delegate binding of elements to unary 
bindings such as <fb:value>.
- the widget (including form) attributes, allowing to pass arbitrary 
data between flowscript and the various js snippets in the form 
definition, without relying on some global variables that would break 
the context isolation of continuations.

So you could store your selection list (or a collection representing it) 
and use it in a js binding on the repeater.

Hope this helps!


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message