Hi florian

you missed class name:

<fb:insert-bean classname="TestField" addmethod="addTestField"/>

Insert TestField with full package



Dev at weitling ha scritto:
> Hello folks,
>
> I'm working for days on a binding problem. Narrowing the context of my
> problem (nested repeaters) I'm still stuck with the configuration
> described below (with 2.1.10, standard config). Everything loads fine
> but when I hit the "Add row"-button a row is created without even
> touching my beans/methods. I would at least expect an error when I omit
> the target method or give an unavailable class.
>
> Maybe I'm doing something fundamentally wrong but I can't see the
> difference to examples known as working from the net.
>
> :-?
> Florian
>
>
> #### flowscript ####
> function test2 () {
>     var form = new Form("definitions/test2.xml");
>     form.createBinding("bindings/test2.xml");
>     var bean = new Packages.demo.Test2();
>     form.load(bean);
>     form.showForm("templates/test2.xml");
>     cocoon.sendPage("success");
> }
>
> #### definitions/test2.xml ####
>         <fd:repeater id="testRepeater">
>             <fd:widgets>
>                 <fd:field id="testField">
>                     <fd:datatype base="string"/>
>                 </fd:field>
>             </fd:widgets>
>         </fd:repeater>
>        
>         <fd:repeater-action id="addTestField" repeater="testRepeater"
> command="add-row">
>             <fd:label>Add row</fd:label>
>         </fd:repeater-action>
>
> #### bindings/test2.xml ####
>     <fb:repeater id="testRepeater" parent-path="." row-path="testFields">
>         <fb:on-bind>
>             <fb:value id="testField" path="testText"/>
>         </fb:on-bind>
>        
>         <fb:on-insert-row>
>             <fb:insert-bean addmethod="addTestField"/>
>         </fb:on-insert-row>
>     </fb:repeater>
>
> #### templates/test2.xml ####
>             <ft:repeater id="testRepeater">
>                 <div>
>                 <ft:repeater-rows>
>                     <ft:widget id="testField"/>
>                 </ft:repeater-rows>
>                 </div>
>             </ft:repeater>
>                        
>             <ft:widget id="addTestField"/>
>
>
> #### demo.Test2.java ####
>     Collection testFields = new ArrayList();
>    
>     public Test2 () {
>         testFields.add(new TestField("argh"));
>         testFields.add(new TestField("urks"));
>         testFields.add(new TestField("blubb"));
>     }
>    
>     public Collection getTestFields () {
>         return testFields;
>     }
>
> #### demo.TestField.java ####
>     String testText;
>    
>     public TestField (String testText) {
>         this.testText = testText;
>     }
>    
>     public String getTestText () {
>         return testText;
>     }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>   





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to