Kirix Support Forums
How to click on button?
5 posts
• Page 1 of 1
How to click on button?
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?
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().
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
Kirix Support Team
-
Aaron - Kirix Support Team
- Posts: 120
- Joined: Fri Dec 16, 2005 3:01 pm
Re: How to click on button?
But if I disable js?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().
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?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.
- qbin
- Registered User
- Posts: 10
- Joined: Thu Jul 30, 2009 8:05 am
Re: How to click on button?
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.
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
Kirix Support Team
-
Aaron - Kirix Support Team
- Posts: 120
- Joined: Fri Dec 16, 2005 3:01 pm
Re: How to click on button?
Thanks, I try this.
- qbin
- Registered User
- Posts: 10
- Joined: Thu Jul 30, 2009 8:05 am
5 posts
· Page 1 of 1
Return to wxWebConnect Questions, Thoughts & Feedback