You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michel Erard <mi...@besonet.ch> on 2005/05/18 22:05:56 UTC
some help with binding
hello,
I've a problem with the binding framework, because I do not realy
understand how it works.
I've a form like this:
<fd:widgets>
<fd:struct id="section1">
<fd:widgets>
<fd:field id="00001" required="false">
<fd:label><eI18n:text>00003</eI18n:text></fd:label>
<fd:datatype base="string"/>
<fd:validation>
<fd:length max="30">
<fd:failmessage><eI18n:text>00004</eI18n:text></fd:failmessage>
</fd:length>
</fd:validation>
<fd:help><eI18n:text>00004</eI18n:text></fd:help>
</fd:field>
<fd:field id="00002" required="false">
<fd:label><eI18n:text>00005</eI18n:text></fd:label>
<fd:datatype base="string"/>
<fd:validation>
<fd:length max="30"/>
</fd:validation>
<fd:help><eI18n:text>00006</eI18n:text></fd:help>
</fd:field>
....
<fd:struct id="section2">
<fd:widgets>
<fd:field id="00003" required="false">
...
</fd:widgets>
And a corresponding binding:
<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
path="/" >
<fb:value id="00001" path="00001"/>
<fb:value id="00002" path="00002"/>
<fb:value id="00003" path="00003"/>
<fb:value id="00004" path="00004"/>
<fb:value id="00005" path="00005"/>
</fb:context>
But this don't work. What do I make wrong?
The Binding-Object is a HashMap with String Keys ("00001", "00002",
...) and I want to display the already saved data from the Map on open
the form and save the changed values in the map after commiting the
form.
The error is:
org.apache.cocoon.forms.binding.ValueJXPathBinding: Widget "00001" does
not exist in the top-level form-widget
Thanks,
Mike