I'm using pyjd/hulahop/pyxpcom to load a HTML document with an input field, this input field is bound with "onchange=...." to some JS function doing some AJAX call.
The html looks like this:
...
<input name="inp" type="text" onchange="checkInput()"></input>
...
I can easily locate and modify the input field with this code:
import pyjd
pyjd.setup(URL)
bw = pyjd.hula.wv
doc = bw.getDomDocument()
inp = doc.getElementsByName("inp").item(0)
inp.value = "somestring"
However, that doesn't trigger the "onchange" handler, it seems I have to manually tab into/out of the input field to do so. From what I've seen the pyxpcom interface is pretty close to the C++ one, thats why I read a bunch of C++ snippets out there, I tried a couple of things using the FocusManager interface, issuing .focus() and .blur() events on the "inp" element, but no success so far.
Does somebody know how this is supposed to work? Is it even possible? Is there some way to call the attached onchange handler directly?
P.S.: Sorry for the pyjamas tag, I'm not allowed to create a 'pyjd' tag :-)