Re: Increase performance

"Rajat Gogri" <[email protected]> Wed, 10 Oct 2007 22:06:01 -0400
Newsgroups gmane.comp.mozilla.jrex
Message-ID <[email protected]>
--===============0282696904==
Content-Type: multipart/alternative; 
	boundary="----=_Part_14683_12867450.1192068361079"

------=_Part_14683_12867450.1192068361079
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello Guys,

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

------=_Part_14683_12867450.1192068361079
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div>Hello Guys,</div>
<div>&nbsp;</div>
<div>initMouseEvent() from JRex is not working for me to simulate mouse click event. Could any one please post the code.</div>
<div>&nbsp;</div>
<div>I am using Jrex for seamonkey version. Do I need to change anything in seamonkey code??</div>
<div>&nbsp;</div>
<div>when I do DispatchEvent() it does not follow the link and returns false.</div>
<div>&nbsp;</div>
<div>Please let me know the any changes needed in JRex or Seamonkey code to make this code work. It is very urgent.</div>
<div>&nbsp;</div>
<div><strong>I am pasting my code here</strong></div>
<div>
<p><font color="#3333ff">JRexHTMLDocumentImpl htmlDOM = (JRexHTMLDocumentImpl)navigator.getDocument();<br>HTMLCollection links = htmlDOM.getLinks();&nbsp;&nbsp;&nbsp;</font></p>
<p><font color="#3333ff">JRexHTMLAnchorElementImpl link1 = (JRexHTMLAnchorElementImpl) links.item(1);<br>JRexEventTargetImpl clickEvent = (JRexEventTargetImpl)link1.getEventTarget();<br>JRexMouseEventImpl mouseEvent = (JRexMouseEventImpl) (((JRexHTMLDocumentImpl) htmlDOM).getDocumentEvent().createEvent(&quot;MouseEvents&quot;));
<br>JRexDocumentViewImpl dv = (JRexDocumentViewImpl) ((JRexHTMLDocumentImpl) htmlDOM).getDocumentView();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>mouseEvent.initMouseEvent(&quot;click&quot;, true, true, dv.getDefaultView(), 1, 1, 2, 1, 2, false, false, false,false, (short)0, clickEvent);
<br>boolean check = clickEvent.dispatchEvent(mouseEvent);</font></p></div>
<div>Thanks,</div>
<div>Rajat</div>
<div><br><br>&nbsp;</div>

------=_Part_14683_12867450.1192068361079--

--===============0282696904==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
JRex mailing list
[email protected]
http://mozdev.org/mailman/listinfo/jrex

--===============0282696904==--