This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Dec 4, 2007 2:03 PM by Alexander Kireyev  
Alexej   2 posts since
Nov 30, 2007
Currently Being Moderated

Dec 3, 2007 7:58 PM

onchange-event in a select-element

By select of any option in a SELECT-field is onchange-event (javaScript function)  not released.

I tried:

HTMLSelectElement.setSelectedIndex();

HTMLOptionElement.select();

emulation of mouse click...

 

Helps only direct call: browser.evaluateScript(selectElement.getAttribute("onchange"))

but is a but is a temporary solution...

 

Is there some way around that?

Using jxbrowser-1.0.eap2.

Thanks,

Alex

Alexander Kireyev TeamDev Ltd. 9 posts since
May 3, 2007
Currently Being Moderated
1. Dec 4, 2007 2:03 PM in response to: Alexej
Re: onchange-event in a select-element

All the event generation and processing in JxBrowser is performed by the Gecko engine of Mozilla. There is no JxBrowser-specific functionality that operates with web page elements apart from that available via getDocument and evaluateScript methods.

 

There are 2 things you can try here:

- Use some Mozilla-specific resource to find out whether it is possible to achive what you need using JavaScript.

- Try using java.awt.Robot to simulate mouse clicks.

More Like This

  • Retrieving data ...