Embed link in webHtmlViewer to go to another page in app

Good morning.

I need to (client would like) display some text in an html view in a web app. Text would contain some links. Some go to other sites. No problem there. However, some links are supposed to reference other “pages” in the app. Is this possible? If not, anyone have a suggested work around?

-Bob Gordon

There’s no way to do it directly, but you can do it by using a hashtag link and the HashTagChanged event of the session. Make sure to set the link to open in the “parent”, not within the htmlviewer, by using target=’_parent’ in the link.

You could subclass the HTMLViewer and handle the CancelLoad event to do a LoadPage with your new HTML

Sorry, I didn’t notice this was a “Web” topic… I know that works in the desktop, but haven’t used the Web app features, so give it a try and see if it works…

I’m not in front of my computer right now, but if I recall correctly, I believe there is an HTML example included with the WebSDK that shows how you could do this.

Paul is exactly right. As a matter of fact, the Getting Started example shows you how to build such a control.

Where exactly can I find that example?

It’s in the first few pages of the WebSDK docs. You can find them in Extras->WebSDK next to the IDE on your computer.

got it - thank you greg.

just another little thing…

does anyone know, what to change in that htmlarea-example to get the external links open in a new window or tab?

thanks.

In the prefix for the link code, you need to add a target attribute like this:

<a target="_blank" href="target.htm">