Hi Hugues,
hugues parvillers wrote:
> I would like to force the new URL inside a script .
> Not by an A action .
So it's easy to do this from your Java Application:
canvas.setURI(...).
If you _really_ need to do this with JavaScript you have
a few options:
1) Bind a custom function/object into the JavaScript
environment:
UpdateManager um = canvas.getUpdateManager();
RunnableQueue rq;
rq = updateManager.getUpdateRunnableQueue();
rq.invokeLater(new Runnable() {
UpdateManager um = updateManager;
public void run() {
ScriptingEnvironment scriptEnv;
scriptEnv = um.getScriptingEnvironment();
Interpreter interp;
interp = scriptEnv.getInterpreter();
interp.bindObject("myObject", myObject);
}
}
2) You should be able to create a 'fake' click event
on a link object (most of the stuff in initMouseEvent can
be faked):
MouseEvent me = doc.createEvent("MouseEvents");
me.initMouseEvent(String typeArg,
boolean canBubbleArg,
boolean cancelableArg,
AbstractView viewArg,
int detailArg,
int screenXArg,
int screenYArg,
int clientXArg,
int clientYArg,
boolean ctrlKeyArg,
boolean altKeyArg,
boolean shiftKeyArg,
boolean metaKeyArg,
short buttonArg,
EventTarget relatedTargetArg);
EventTarget et = doc.getElementById("childOfA");
et.dispatchEvent(me);
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]