[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] simulate mouse select in dropdown in QWebView
From:       Jiangcheng Bao <jbao605 () gmail ! com>
Date:       2013-05-22 1:25:33
Message-ID: CAD4xec5wmF7UZmdTVFUsDfCbxJyxm0zRtBrdF41BPo0M2W53EQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I am trying to simulate a mouse select a dropdown selection, but the
following code doesn't seem to work:

            select_elm = browser.findFirst('select[id="myselect"]')
            if not select_elm.isNull():
                select_elm.evaluateJavaScript("this.selectedIndex=1")

It neither changes the selected child element, nor does it trigger the
changes on the page that a manual user select would have done.

I'd like to simulate mouse select because it would also trigger other
changes on the page, so just trying to set the option element inside does
not do what I need.

Anybody has experience with this?

Thanks
Bao

[Attachment #5 (text/html)]

<div dir="ltr">I am trying to simulate a mouse select a dropdown selection, but the \
following code doesn&#39;t seem to work:<div><br></div><div><div>            \
select_elm = browser.findFirst(&#39;select[id=&quot;myselect&quot;]&#39;)</div> <div> \
if not select_elm.isNull():</div><div>                \
select_elm.evaluateJavaScript(&quot;this.selectedIndex=1&quot;)<br></div></div><div><br></div><div \
style>It neither changes the selected child element, nor does it trigger the changes \
on the page that a manual user select would have done.</div> <div><br></div><div \
style>I&#39;d like to simulate mouse select because it would also trigger other \
changes on the page, so just trying to set the option element inside does not do what \
I need.</div><div style><br></div><div style> Anybody has experience with \
this?</div><div style><br></div><div style>Thanks</div><div \
style>Bao</div><div><br></div></div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic