Kirix Support Forums

How to click on button?

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

How to click on button?

Postby qbin on Tue Aug 11, 2009 12:07 pm

Hello, wxDOMHTMLButtonElement class don't have click or another,how click on button in my program?
qbin
Registered User
 
Posts: 10
Joined: Thu Jul 30, 2009 8:05 am

Re: How to click on button?

Postby Aaron on Wed Aug 12, 2009 11:28 am

Normally, in the DOM, you'd dispatch an event on the element in question, but, as you've noted, this isn't currently available in the API.

One workaround is to create a wxString that contains a JavaScript function definition for dispatching this event. Once you have this function definition, add it to the DOM using the available interface and invoke it using wxWebConnect::Execute().
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Re: How to click on button?

Postby qbin on Wed Aug 12, 2009 1:41 pm

One workaround is to create a wxString that contains a JavaScript function definition for dispatching this event. Once you have this function definition, add it to the DOM using the available interface and invoke it using wxWebConnect::Execute().
But if I disable js?
Normally, in the DOM, you'd dispatch an event on the element in question, but, as you've noted, this isn't currently available in the API.
Can you take small code snippet? If I use dom like in testapp method getValue for each button return zero-string...Maybe I can use usual COM?
qbin
Registered User
 
Posts: 10
Joined: Thu Jul 30, 2009 8:05 am

Re: How to click on button?

Postby Aaron on Wed Aug 12, 2009 10:48 pm

Without knowing more about your intended use, it's hard to know if disabling JavaScript is necessary, but we'll rule out this possibility for now.

In any case, the best solution is to implement the remaining functions on the nsIDOMEventTarget interface, which includes RemoveEventListener() and the DispatchEvent() function you need. We'd like to see this happen, and would welcome your help if you're willing to implement a well-coded solution. To learn more about how to do this, take a look at some of the DOM interfaces in nsall.h, and how they're implemented in dom.h, domprivate.h and dom.cpp, then follow a similar pattern for nsIDOMEventTarget.
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Re: How to click on button?

Postby qbin on Thu Aug 13, 2009 3:25 am

Thanks, I try this.
qbin
Registered User
 
Posts: 10
Joined: Thu Jul 30, 2009 8:05 am

Return to wxWebConnect Questions, Thoughts & Feedback