> Unfortunately, I do no longer have that inside view of CForms. But I
> wonder if you have access to the Java API. ContainerWidgets like Form
> have a method getChildren() returning an Iterator. With it you can
> traverse the form model recursively and store the values by the widgets'
> getFullName().
> 
> pseudo code:
> 
> storeValue(formObject.getModel());
> 
> function storeValue(model) {
>    if (model instanceof ContainerWidget) {
>      for (children in model.getChildren()) {
>        storeValue(children);
>      }
>    } else {
>      // use model.getFullName() and model.getValue() for storing
>    }
> }
>

I do. But for example dataModel.getChildren() is not defined (throws an error).
Maybe I'm too stupid to find the right class.
In Form.js, it says

function Form(formDefinition) {
...
this.formWidget = new Widget(this.form);
...
}

Form.prototype.getModel = function() {
    return this.formWidget;
}


So the returned object must be of class Widget.
I found a JavaAdapter-thing with a Java-interface in Widget.java (lies in 
src.blocks.forms.java.org.apache.cocoon.forms.formmodel) and the corresponding 
Widget.js (lies in 
src\blocks\ajax\resources\org\apache\cocoon\dojo\resources\dojo-0.3.1-widget\src\widget).
(I assume - am I wrong?)

But I can't call the functions defined there, so it must be the wrong class.
The toString()-method of my object likely returns something else than defined 
there.

Seems like I've been barking at the wrong tree, but where shall I look for that 
class?

  
> I only wonder how you get the data back into the form model after the
> continuation gets called. Is there some pageLocal.restoreState() in
> which you can write your loadValue() code?

Actually I don't know how that PageLocal-object works, but it sets back itself. 
I do not trigger that explicitly. I assume the pageLocla.object saves a state 
of himself referenced by the continuation-id. But this is only an assumption.


> 
> Also the above looks very much like some data binding. Maybe you can
> just reuse the binding framework.

What do you mean by that?

> 
> > This doesn't work, because it seems to be a Java object.
> > I found out, that the dataModel-Object must be an instance of Widget.
> > But in Widget.java I cannot find how the values are held.
> 
> Can't follow this part. Is this the same idea I outlined above - and it
> does not work? And for what reason? Widget hast a method getValue().

Yes, I wanted to say, that reading the values in a loop doesn't work.
And getValue should return the value of a inner(e.g. a field-widget) widget, so 
I don’t understand why using it here.
?


> 
> Hope this helps,
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




So, where is the class definition of the object that is returned by 
formModel.getModel()
?

Regards, Franzi

PS: And thanks a lot for your help and your trying to understand my problem so 
far. I appreciate that very much and hope you won't give up soon... ;)


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

Reply via email to