From: Ulaszek, R. <Rya...@in...> - 2005-06-09 01:06:43
|
Hello, I am trying to load some java script buisness logic into a java app using rhino and ran into a problem with calls being made to setInterval which is a DOM function. I am trying to use html units SimpleScriptable but am not sure on how to use it. I am hoping that using that object will provide DOM support. Is this true? This is what I am trying to do with rhino. Anyone have suggestions on how to do this with htmlunit? Any help is greatly appreciated. Thanks public void getCalcs(Context cx) { ScriptableObject shell = new ScriptableObject(); Object fObj2 = shell .get("setFormField", shell ); if (!(fObj2 instanceof Function)) { System.out.println("field is undefined or not a function."); } else { Object functionArgs[] = { "muniIntNonAz", "3","azAgi" }; Function f2 = (Function)fObj2; Object result = f2.call(cx, shell , shell , functionArgs); String report = Context.toString(result); System.out.println(report); } } I tried this public void getCalcs(Context cx) { SimpleScriptable shell = new SimpleScriptable(); Object fObj2 = shell .get("setFormField", shell ); if (!(fObj2 instanceof Function)) { System.out.println("field is undefined or not a function."); } else { Object functionArgs[] = { "muniIntNonAz", "3","azAgi" }; Function f2 = (Function)fObj2; Object result = f2.call(cx, shell , shell , functionArgs); String report = Context.toString(result); System.out.println(report); } } Ryan Ulaszek | QA Software Automation Engineer: | Intuit, Inc. 858-525-9560 |