nico.ruti
nico.ruti

Reputation: 625

Add SelectionListener to SWT Browser

I'm implementing a ad-section in my RAP application (1.5M7). To show the ads, I used SWT Browser. How can I detect user-clicks on the browser (the ad) to be able to forward him to a linked page?

Upvotes: 0

Views: 504

Answers (1)

Tim Buschtöns
Tim Buschtöns

Reputation: 196

If you load the html from an external server, you will not be able to get the click for security reasons. You will have to create a html-document (as a string) that loads the gif/flash object directly (not using an iframe), and set that document using setText. Then you can get the click using a BrowserFunction instance. For a gif this is simple: <img src="your_ad.gif" onclick="your_browser_function();">. I do not know how to get a click from a flash object.

Upvotes: 1

Related Questions