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 Mon, 04 Oct 2004 08:34:16 GMT
oceatoon wrote:

>Merci Sylvain,
>>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>.
>Are there any documents about <fb:child-bindings>, I have googlised it and
>wiki-searched it but haven't found any links to this ? 

Ahem... it's currently only in the source file's javadoc:

>>- 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.
>This was my first attempt: mapping my repeater on the selection-list. but my
>problem was about internationalisation, I managed to map my repeater on the
>selectionlist files content, but internationalisation wasn't made?
>because widget.setValue() won't take a Node as parameter, and as a String
>the i18n:text tag aren't tranformed :(
> (even though my pipeline ends with the right transformation)

Mmh.. I see the problem. Are the i18n keys related to the selection list 
item values, i.e. can you use an item's value to build the corresponding 
i18n key? If yes, then that's a good candidate for the implementation of 
CForms template as JX macros I'm about to commit today.

Using these macros (assuming the selection-list's value is stored in a 
"item" output widget), you'll be able to write:
<ft:repeater id="repeat">
  <i18n:text key="${widget.getChild('item').getValue()}"/>
  <ft:widget id="other-widget"/>

>Passing the selection-list as an attribute from the widget definition sounds
>good, is there any documentation about this?

Look at the Widget interface, which has get/setAttribute methods. It's 
as simple as that.


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

View raw message