Open weblink in browser

Questions, tips and tricks and techniques for scripting in Servoy

Open weblink in browser

Postby reapp » Thu Jun 10, 2010 11:57 am

On my form, I use the browserbean to show a webpage with news items.
Is it possible if you click on the link, that it opens in the browser of the user?

Or is it possible that it opens in an another window?
reapp
 
Posts: 6
Joined: Tue Jan 05, 2010 12:24 pm

Re: Open weblink in browser

Postby Harjo » Thu Jun 10, 2010 12:52 pm

Yes, use the onLocationChanging Event for that

with for example this method:
Code: Select all
function onLocationChanging(event,vURL)
{
   if (vURL && vURL != 'about:blank') {
      elements.bean_842.stopLoading()
      application.showURL(vURL)
   }
}


Hope this helps..
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Open weblink in browser

Postby ptalbot » Thu Jun 10, 2010 3:04 pm

@Harjo:
Great to see how you master the BrowserSuite! :wink:

@reapp:
Yes, Harjo is right, if you want to open it in the user's browser, that's the way to do it.

Otherwise, if you only want to open a new (BrowserBean) window, you can either set the target of you link to "_blank" or use a window.open() javascript function, both works fine!
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Open weblink in browser

Postby reapp » Fri Jun 18, 2010 10:32 am

Many thanks!! It works for me now.
reapp
 
Posts: 6
Joined: Tue Jan 05, 2010 12:24 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 5 guests