oceatoon wrote:
Merci Sylvain,
These are:Are there any documents about <fb:child-bindings>, I have googlised it and
- 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>.
wiki-searched it but haven't found any links to this ?
Ahem... it's currently only in the source file's javadoc: http://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java
- 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"/>
</ft:repeater>
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
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }