Page 1 of 1

Accessing a specific URL from within the code

Posted: 20 Feb 2017 5:30
by Frank
Hello,
Environment VP 7.4 Commercial Edition.
I am trying to access an specific URL www.abc.com from within a dialog box when someone clicks on the cancel button. I am using the following code inside the program :

Code: Select all

... predicates     onCancelClick : button::clickResponder. clauses     onCancelClick(_Source ) = button::defaultAction:-       URL = "www.abc.com",     cancel_ctl:navigate(URL). ...
When I compile I get an error message: undeclared identifier ' navigate/1'

I would appreciate any feedback.

Thanks,
Frank

Posted: 21 Feb 2017 8:49
by Thomas Linder Puls
A button is a user interface element that can basically receive clicks, to "access a URL" you will need something that can do that.

It is however not clear what you mean by "access a URL". Should it open in an external browser or do you which to load it somewhere in your dialog, or what?

Accessing a specific URL from within the code

Posted: 21 Feb 2017 17:29
by Frank
Thanks Thomas.

All I want to open the website in an external browser, once the button is clicked.

Or alternatively if it makes it easier, I would like to put a URL link in my dialog box such that once someone clicks on that to open that website in an external browser.

Best,
Frank

Accessing a specific URL from within the code

Posted: 24 Feb 2017 18:46
by Frank
I was able to find the webBrowser code in the example section that deals with the URLs.
Apparently opening a URL in an external browser is achieved through the webBrowserControl type control( which is not an standard Control) on the Form. But I cannot figure out how to include such a control on a Form.

Posted: 26 Feb 2017 13:55
by Thomas Linder Puls
If you want to open an URL in an independent browser, which your program should not otherwise control or interact with, then you should use call shell_api::shellOpen with the URL.

But if you want to open it in a separate browser that your program control, then you should use the internetExplorer class.

And finally if you want to have a web browser embedded directly in your own dialog then you should use the webBrowser control.

Accessing a specific URL from within the code

Posted: 26 Feb 2017 18:12
by Frank
Thank you Thomas.
For now I used webBrowser control and it works fine for what I wanted to do.

Best,
Frank