Using application.showURL problem

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.

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.

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.

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

I’m talking about the smart-client!

Hi Cristina,

does your url start with “http://” in the method and not with ‘www’ ?

I have to be precise:

We use it with a link like this:

application.showURL('file://c:/Offerte test.pdf')

This does not work in developer AND smart-client.

Try this:

var f = "file:///tmp/file with space.html"
application.showURL(encodeURI(f))

Rob

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

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

Rob

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

Cristina,

Please note that this is very windows-specific.

Rob

Yes, I know but our application is meant to run only on windows.
Anyway I cant find a better solution so for the moment its ok.

Cristina

you can do this also for Windows & Mac:

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);
}
}

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?

thats a limitation of a browser.
A get request (url in the browser) are max 2000 chars yes for the most browsers.

jcompagner:
thats a limitation of a browser.
A get request (url in the browser) are max 2000 chars yes for the most browsers.

In most cases you can address by changing to post. The http plugin can do posts as well.

So I assume, since I’m passing to Outlook, it acts exactly the same way as if I were passing to, say, Firefox.

Thanks for the 411 on http plugin!