Getting object information on left click.

Add-in Express™ Support Service
That's what is more important than anything else

Getting object information on left click.
 
ravinukala




Posts: 103
Joined: 2012-10-05
Hi,

I am developing plug in for IE, in which I am learning web objects. I want to learn the objects on left click.
I am able to do so using OnClick event, but problem is links,buttons. Whenever OnClick happen it fires Click event of element and page redirects to another page.

How can I cancel the click event of elements?
"e.Cancel = true" is not helping out.

Thanks
Posted 08 Oct, 2012 08:58:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Ravi,

You can use the 'ADXIEHTMLDocEvents' component to intercept left click. The 'SupportedEvents' property can be set to 'Document' or any other type of HTML elements, e.g. 'Anchors;Link'.
Posted 09 Oct, 2012 04:54:49 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi Sergey,

Thanks for your reply. I have done the things mentioned by you. It is failing Achors as "href" property is there.


Is there any way out?

Thanks
Posted 09 Oct, 2012 05:35:40 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Ravi, how can I reproduce the issue? Do you have a sample web page for testing?
Posted 09 Oct, 2012 09:16:24 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi,

You can go to google.com Search any thing there you will get lots of links there.

Thanks
Posted 10 Oct, 2012 05:18:57 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Ravi,

I managed to reproduce the issue. I think that it happens because this is the dynamic content. 'F12 Developer Tools' doesn't work correctly with these links as well. At the moment I don't have any solution for this issue.
Posted 10 Oct, 2012 08:56:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Ravi, please try to cancel the navigation in the BeforeNavigate2 event handler.
E.g.
private void IEModule_BeforeNavigate2(ADXIEBeforeNavigate2EventArgs e)
{
if (this.IEApp.LocationURL.Contains("output=search"))
{
e.Cancel = true;
this.IEApp.Stop();
}
}
Posted 10 Oct, 2012 09:22:57 Top