Sylvain Wallez wrote:
Stephan Coboos wrote:
Hello,
is it possible to iterate other a model object within a flowscript? The model object was retrieved before by calling form.getModel().
Yes, you can use lookupWidget() that accepts a path-like syntax (i.e. "a/b/c" or "../d")
Another question: Is there an API doc available for this object?
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/package-summary.html
Sylvain
Hi Sylvain,
that's why I'am a little bit confused about the documentation because model.lookupWidget("age") as well as other methods from type Widget doesn't work in my flowscript. I got this exception:
Original Exception: TypeError: lookupWidget is not a function. (file:/E:/container/instances/testsys/webapps/evalsys/app/flows/fillOut.js; line 13) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:581) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:541)
In the listing below you can see the part in my flowscript:
var form = new Form("cocoon:/formDefinition/" + inquiryName); form.showForm("formTemplate/" + inquiryName);
var model = form.getModel(); print("Widget: :" + model.lookupWidget("age"));
What's wrong here? Thank you for your help!
Regards Stephan