Trouble using "JSObject" class from a PJC [message #397943] |
Tue, 14 April 2009 12:03 |
chrisK17
Messages: 12 Registered: January 2008
|
Junior Member |
|
|
Hey All,
I'm trying to build a PJC that will allow me to control the opening, closing and redirection of other web windows through a Forms FMX. Although "web.Show_document" lets you open new windows, I can't close the window it opened nor can I redirect (ie reuse) the window it opened.
I'm trying to do this using the "JSObject" java class. (netscape.javascript.JSObject).
I've read up this week on how to create PJCs. I have the jar file developed, and my form is linked with the jar file and I can output text to the java console by calling a method in my java class using code like:
fbean.register_bean('DUMMY.JAVASCRIPT_BEAN', 1, 'FormsJS');
fbean.invoke( 'DUMMY.JAVASCRIPT_BEAN', 1, 'executeJS', 'test');
However, as soon as I call any method from the JSObject, it just dies. I've read some documentation on how it works, and this is how I am doing it:
//mFormsMain is a private class variable of type
//oracle.forms.engine.Main, set in the "init" routine
JSObject win = JSObject.getWindow(mFormsMain);
win.eval("alert('here i am!');");
When I execute this, I don't get the javascript alert I was hoping for, it does nothing. If I put system.out.println statements before and after the "JSObject win..." statement, the one before is printed but the one after is not. I don't see any stack traces in the java console nor does the application crash, so I am perplexed. I've tried other methods on the JSObject class and I get the same results.
Has anyone successfully used this before? Does anyone have any advice on how to do this or what I am doing wrong?
Thanks a lot.
|
|
|
|
|