cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: [CForms]can I dynamic bind repeaters in js on form define?
Date Wed, 07 Apr 2004 10:23:33 GMT
On 01.04.2004 12:05, roy huang wrote:

> In carselector_form.xml from Cocoon Forms samples :
>    <fd:field id="make" required="true">
>       <fd:label>Make:</fd:label>
>       <fd:datatype base="string"/>
>       <fd:selection-list src="cocoon:/cars" dynamic="true"/>
>       <fd:on-value-changed>
>         <javascript>
>           java.lang.System.err.println("maker changed from " + event.oldValue + " to
" + event.newValue);
>           var value = event.source.value;
>           var typewidget = event.source.parent.getWidget("type");
>           if (value != null) {
>             // Get the corresponding type list
>             typewidget.setSelectionList("cocoon:/cars/" + value);
>        ....
> 
> 
> I use a repeater to show table to do the same thing like multi-value's selectionlist.Can
I rebind only the repeater just like setSelectionList?
> If it can't ,I can use XXX.addRow() to do the similar thing,but how can I get the value
from a pipeline(like cocoon:/cars/)?

I don't know if I understood your question correctly, but the default
way does nothing else then creating the binding in the script:

java\org\apache\cocoon\forms\flow\javascript\Form.js, handleForm():

    var bindingURI = cocoon.parameters["bindingURI"];
    if (bindingURI != null) {
        form.createBinding(bindingURI);
    }

samples\forms\flow\binding_example.js:

function form2bean(form) {
    var bean = new Packages.org.apache.cocoon.forms.samples.Form2Bean();

    // fill bean with some data
    ...

    form.load(bean);
    form.showForm("form2-display-pipeline");
    form.save(bean);

    cocoon.sendPage("form2bean-success-pipeline", {"form2bean": bean});
}

Joerg


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


Mime
View raw message