cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dev at weitling <d...@weitling.net>
Subject Re: HashMap in repeater binding via javascript
Date Sat, 05 Jan 2008 23:21:35 GMT


Jason Johnston wrote:
> On Fri, 04 Jan 2008 17:10:13 +0100, Dev at weitling <dev1@weitling.net>
> wrote:
>   
> I haven't actually *tried* it, but I think you want something like this:
>
> <fb:repeater id="localeRepeater" path="entrySet(locales)">
>
> Because it's a regular (non-static) method I don't think you need the
> package/class prefix, and the argument should be the Map object found at
> the "locales" path

I tried your tip as well as that from Grek (thanks, Grek :-)). Till now 
I manage to get no error message and binding goes through my three test 
entries as inserting some javascript code proved. But my <body> is 
completely empty:

bindings/test.xml:
    <fb:repeater id="testRepeater" parent-path="." row-path="entrySet(.)">
        <fb:identity>
            <fb:value id="keyField" path="key"/>
        </fb:identity>
        <fb:on-bind>
            <fb:value id="valueField" path="value"/>
        </fb:on-bind>
    </fb:repeater>

templates/test.xml:
    <body>
        <ft:repeater id="testRepeater">
            <table>
                <ft:repeater-rows>
                    <tr>
                        <td>
                            <ft:widget id="keyField"/>
                        </td>
                        <td>
                            <ft:widget id="valueField"/>
                        </td>
                    </tr>
                </ft:repeater-rows>
            </table>
        </ft:repeater>
    </body>


the flow:
    var form = new Form("definitions/test.xml");
    form.createBinding("bindings/test.xml");
    var bean = new Packages.java.util.HashMap();
    bean.put("de","deutsch");
    bean.put("fr","francais");
    bean.put("en","english");
    form.load(bean);
    form.showForm("templates/test.xml");

What kind of mystics is going on here? Maybe it's just some simple tweak 
necessary...

Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message