cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject flow - java.util.Object[] {something} causes syntax Error
Date Wed, 24 Aug 2005 19:18:00 GMT
Hi all,

I am trying to activate cforms in Lenya's usecase-fw.

For this I need to execute javascript snippets that are coming from a
configuration file. e.g. 
 form.setAttribute("counter", new java.lang.Integer(0));

Antonio pointed me to

I tested before with execScript (I started with that) like:
but that did not work.

I created a function which I want to access in the flow script. I am
trying to use "public static Object callFunction(Function func, Object
thisObject, Object[] arguments, Map objectModel)" from within my *flow*

Instead of using:
form = new Form(viewDef);
form.setAttribute("counter", new java.lang.Integer(0));

I want to use:
var flowHelper =
var objectModel = flowHelper.getObjectModel(cocoon);
var jsHelper = new;
form = new Form(viewDef);
jsHelper.callFunction(view.getTestFunction(),form,new java.util.Object[]
{form}, objectModel);

As soon as I try:
var test = new java.util.Object[] {"test"};

I get:
Caused by: SyntaxError: syntax error
(file:/home/thorsten/apache/lenya-trunk/build/lenya/webapp/lenya/usecases/usecases.js; line
which is above line.

How can I use JavaScriptHelper.callFunction if I cannot create an

Is there another way to create a Object[] then the above mentioned? Is
this a bug?

Is there a better way to execute javascript that is stored in a string?



"Together we stand, divided we fall!" 
Hey you (Pink Floyd)

Thorsten Scherler
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya               

View raw message