Using application.showURL problem

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Using application.showURL problem

Postby kitty » Fri Apr 20, 2007 3:42 pm

Hello.

In my Servoy application, I use the application.showURL function to open a web browser with the following URL:

http://www2.studiebijbel.nl/scripts/Web ... n&email=...

This is a valid URL and on my computer it works corectly.
I tested the application on another computer and the browser do not open and I have a red message in Servoy bottom bar:

"If running in client this url is shown in browser : ...the url"


Do you have any idea what could be happening?

Thank you,
Cristina.
User avatar
kitty
 
Posts: 20
Joined: Mon Sep 25, 2006 1:27 pm
Location: Romania

Postby Jan Aleman » Sat Apr 21, 2007 9:56 am

Servoy Developer doesn't open the URL but if you would run the same method in Servoy Client it will. Try running it in Client.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harjo » Sat Apr 21, 2007 10:06 am

We have the same issue IN the client.

for some reason if you have spaces (%20) or so in the url, the url won't open in the client also.

I have talked to Johan about it and he would look into that.
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

Postby rgansevles » Mon Apr 23, 2007 3:19 pm

Are you talking about the web client of the smart client.
And what Servoy/OS/java/browser versions are you using?

I created a simple solution with a button that call showUrl with the above URL and this worked fine.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Postby Harjo » Mon Apr 23, 2007 3:27 pm

I'm talking about the smart-client!
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

Postby sanneke » Mon Apr 23, 2007 4:00 pm

Hi Cristina,

does your url start with "http://" in the method and not with 'www' ?
Sanneke
Yield Software Development: Need help on your project?
yieldsd.com
User avatar
sanneke
 
Posts: 383
Joined: Thu Jun 15, 2006 9:20 am
Location: Amersfoort

Postby Harjo » Mon Apr 23, 2007 4:07 pm

I have to be precise:

We use it with a link like this:
Code: Select all
application.showURL('file://c:/Offerte test.pdf')


This does not work in developer AND smart-client.
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

Postby rgansevles » Tue Apr 24, 2007 10:57 am

Try this:
Code: Select all
var f = "file:///tmp/file with space.html"
application.showURL(encodeURI(f))
Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Postby kitty » Tue Apr 24, 2007 1:40 pm

I run the application after I build it with Servoy runtime builder. In developer the link works ok, in the runtime it doesn`t work.

Is encodeURL() a Servoy function or how can I define it? I have to try it.

Cristina
User avatar
kitty
 
Posts: 20
Joined: Mon Sep 25, 2006 1:27 pm
Location: Romania

Postby rgansevles » Tue Apr 24, 2007 2:11 pm

I used encodeURI, with an I, not encodeURL.
It is a javascript built-in function.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Postby kitty » Tue Apr 24, 2007 3:20 pm

I solved the problem.

I use instead of
application.showURL(globals.url)

application.executeProgram('rundll32', 'url.dll,FileProtocolHandler', globals.url)


and now it works fine in runtime.

Cristina
User avatar
kitty
 
Posts: 20
Joined: Mon Sep 25, 2006 1:27 pm
Location: Romania

Postby rgansevles » Tue Apr 24, 2007 4:29 pm

Cristina,

Please note that this is very windows-specific.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Postby kitty » Wed Apr 25, 2007 9:49 am

Yes, I know but our application is meant to run only on windows.
Anyway I can`t find a better solution so for the moment it`s ok.

Cristina
User avatar
kitty
 
Posts: 20
Joined: Mon Sep 25, 2006 1:27 pm
Location: Romania

Postby Harjo » Wed Apr 25, 2007 10:41 am

you can do this also for Windows & Mac:

Code: Select all
if(utils.stringMiddle(application.getOSName(),1,7) == "Windows")
{
   application.executeProgramInBackground('rundll32', 'url.dll,FileProtocolHandler',globals.url)
} else
{
if (utils.stringLeftWords(application.getOSName(), 1) == "Mac")
{
   application.executeProgram('open', globals.url);
}
}
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: Using application.showURL problem

Postby Providence1 » Wed Mar 17, 2010 8:53 pm

There seems to be a 2000 character limit to the length of characters you can pass with application.executeProgramInBackground('rundll32', 'url.dll,FileProtocolHandler',globals.url)?

Anyone else seeing this?
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY

Next

Return to How To

Who is online

Users browsing this forum: No registered users and 3 guests

cron