Mouse click initMouseEvent() problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Mouse click initMouseEvent() problem

Rajat Gogri
 Hello,

initMouseEvent() from JRex is not working for me to simulate mouse click
event. Could any one please post the code.

I am using Jrex for seamonkey version. Do I need to change anything in
seamonkey code??

when I do DispatchEvent() it does not follow the link and returns false.

Please let me know the any changes needed in JRex or Seamonkey code to make
this code work. It is very urgent.

*I am pasting my code here*

JRexHTMLDocumentImpl htmlDOM =
(JRexHTMLDocumentImpl)navigator.getDocument();
HTMLCollection links = htmlDOM.getLinks();

JRexHTMLAnchorElementImpl link1 = (JRexHTMLAnchorElementImpl) links.item(1);
JRexEventTargetImpl clickEvent =
(JRexEventTargetImpl)link1.getEventTarget();
JRexMouseEventImpl mouseEvent = (JRexMouseEventImpl)
(((JRexHTMLDocumentImpl)
htmlDOM).getDocumentEvent().createEvent("MouseEvents"));
JRexDocumentViewImpl dv = (JRexDocumentViewImpl) ((JRexHTMLDocumentImpl)
htmlDOM).getDocumentView();

mouseEvent.initMouseEvent("click", true, true, dv.getDefaultView(), 1, 1, 2,
1, 2, false, false, false,false, (short)0, clickEvent);
boolean check = clickEvent.dispatchEvent(mouseEvent);
Thanks,
Rajat
_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom