From: Brad C. <yo...@br...> - 2005-06-09 16:18:07
|
I have no idea what you're trying to do but SimpleScriptable (and everything under the javascript package) is internal code. From the package.html: "Classes in this package are specific for the javascript engine - users of HtmlUnit shouldn't need anything in this package." Then there's the fact that creating a SimpleScriptable directly doesn't seem like it would do much good anyway (it should probably be an abstract class but since it isn't really public API...). Brad C --- "Ulaszek, Ryan" <Rya...@in...> wrote: > 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 > > |