Franziska Witzani <franziska.witzani <at> e-tecture.com> writes:
> I do. But for example dataModel.getChildren() is not defined (throws an > error). So you might still be on the JavaScript wrapper hiding the Java API, not the actual Java object. > 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 really wondered about this one as well. What's Widget actually? There is no import in this file, only thing I found was the reference to/ defineClass of ScriptableWidget. > 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. I'd wonder if CForms itself depends on Dojo. Dojo should only be used on the client side. So I *guess* you are wrong, but I don't know actually. > The toString()-method of my object likely returns something else than defined > there. What does it return? Maybe it points to something. > > 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. That's interesting ... > > > > Also the above looks very much like some data binding. Maybe you can > > just reuse the binding framework. > > What do you mean by that? CForms has a binding framework, with which you can bind your form model to a data model (be it objects or XML). I thought before programming binding of form model to a page local and back you could reuse that one. But if PageLocal has so much auto magic you don't need it. > Yes, I wanted to say, that reading the values in a loop doesn't work. Why? > And getValue should return the value of a inner(e.g. a field-widget) widget, > so I don’t understand why using it here. Can't follow again :( In my pseudo code I did some traversing of the form model by using getChildren() (if it would be available). This should give you access to the nested widgets. > So, where is the class definition of the object that is returned by > formModel.getModel()? As Shakespeare wrote: ... that's the question :) > 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... ;) :) I'm quite patient as long as there is some progress and the counterpart is willing to investigate on itself as well. That seems to be the case with you ;) Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]