click simulation

"Rajat Gogri" <[email protected]> Sun, 7 Oct 2007 22:50:09 -0400
Newsgroups gmane.comp.mozilla.jrex
Message-ID <[email protected]>
--===============0079259146==
Content-Type: multipart/alternative; 
	boundary="----=_Part_46782_5206460.1191811809705"

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

 hello,

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

mouseEvent.initMouseEvent("click", *true*, *false*, dv.getDefaultView(), 1,
1, 0, 1, 0, *false*, *false*, *false*,*false*, (*short*) 0, clickEvent);
clickEvent.dispatchEvent(mouseEvent);

I am using this code to simulate click on links from jrex. but this is not
working. I saw that people got it working. Do I need to initialize the
mouseListeners???

Regards,
Rajat

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

<div id="mb_0">
<div align="left"><font size="2">hello,</font></div>
<div align="left"><font size="2">&nbsp;</font></div>
<div align="left"><font size="2">&nbsp;</font><font size="2">JRexHTMLDocumentImpl htmlDOM = (JRexHTMLDocumentImpl)</font></div><font size="2"><font color="#0000c0">navigator</font>.getDocument();<br>JRexHTMLAnchorElementImpl link1 = (JRexHTMLAnchorElementImpl) 
links.item(0);<br>JRexEventTargetImpl clickEvent = (JRexEventTargetImpl) link1.getEventTarget();<br>JRexMouseEventImpl mouseEvent = (JRexMouseEventImpl) (((JRexHTMLDocumentImpl) htmlDOM).getDocumentEvent().createEvent( <font color="#2a00ff">
&quot;MouseEvents&quot;</font>));<br>JRexDocumentViewImpl dv = (JRexDocumentViewImpl) ((JRexHTMLDocumentImpl) htmlDOM).getDocumentView(); </font>
<p align="left"></p>
<p align="left"><font size="2">mouseEvent.initMouseEvent(</font><font size="2"><font color="#2a00ff">&quot;click&quot;</font>, <b><font color="#7f0055">true</font></b>, <b><font color="#7f0055">false</font></b>, dv.getDefaultView
(), 1, 1, 0, 1, 0, <b><font color="#7f0055">false</font></b>, <b><font color="#7f0055">false</font></b>, <b><font color="#7f0055">false</font></b>,<b><font color="#7f0055">false</font></b>, (<b><font color="#7f0055">short
</font></b>) 0, clickEvent); <br>clickEvent.dispatchEvent(mouseEvent); </font></p>
<div align="left">&nbsp;</div>
<div align="left"><font size="2">I am using this code to simulate click on links from jrex. but this is not working. I saw that people got it working. Do I need to initialize the mouseListeners???</font></div>
<div align="left"><font size="2"></font>&nbsp;</div>
<div align="left"><font size="2">Regards,</font></div><span class="sg">
<div align="left"><font size="2">Rajat</font></div></span></div>

------=_Part_46782_5206460.1191811809705--

--===============0079259146==
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

--===============0079259146==--