Issue with creating an e-mail with NGDesktop

Forum to discuss the new web client version of Servoy.

Issue with creating an e-mail with NGDesktop

Postby rph » Thu Oct 21, 2021 1:40 pm

Hi

We use the following code to create an e-mail (not sending it yet):

application.showURL("mailto:aa@abc.com?Subject=Test&Body=Test");

This opens a new e-mail from the default e-mail-client.

But with NGDesktop this also opens a new instance of NGDesktop with a blank page.

How could we omit this opening of a new NGDesktop instance. I've tried to append a second parameter ("_self") to application.showURL but then nothing happens (no new e-mail).

Thanks for any suggestions

Roland

Environment: Servoy 2020.12.1 / Windows 10
rph
 
Posts: 75
Joined: Wed Aug 10, 2011 11:44 am
Location: Cham, Switzerland

Re: Issue with creating an e-mail with NGDesktop

Postby jcompagner » Fri Oct 22, 2021 9:27 am

this is a bit tricky what that should do

are we expecting that showURL() is always going to the system and the browser again to show something?

or do we also want to use it for just showing quickly another webpage that we just want to show and maybe interact with ?


showUrl could also be used for example with:

application.showURL("sameorothersoluton/index.html");
application.exit();


so my feeling is that the "_self" should just do that.. But i am not sure what "_blank" or "mywindow" as a target should then do...

What we can do is for example add a method on plugins.ngdesktoputils.showExternal(url);

an that url is then passed to the system to process and application.showUrl() just opens NGDesktop windows.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Issue with creating an e-mail with NGDesktop

Postby rph » Fri Oct 22, 2021 10:25 am

Thanks for your reply, Johan. I've opened a case for that: https://support.servoy.com/browse/SVY-16573
rph
 
Posts: 75
Joined: Wed Aug 10, 2011 11:44 am
Location: Cham, Switzerland

Re: Issue with creating an e-mail with NGDesktop

Postby robert.edelmann » Sun Oct 24, 2021 5:09 pm

In the meantime you can basically do something like this:

Code: Select all
         var osName = application.getOSName();
         if (/Windows/.test(osName)) {
            plugins.ngdesktoputils.executeCommand('rundll32', ['url.dll,FileProtocolHandler', url]);
         } else if (/Linux|Freebsd/.test(osName)) {
            plugins.ngdesktoputils.executeCommand('mozilla', [url]);
         } else if (/Mac/.test(osName)) {
            plugins.ngdesktoputils.executeCommand('open', [url]);
         }

'url' is the URL to be opened.
I'm not 100% sure about Linux, but Mac and Windows work.
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 91
Joined: Wed Aug 14, 2013 6:12 pm

Re: Issue with creating an e-mail with NGDesktop

Postby rph » Mon Oct 25, 2021 8:12 am

Thanks for this workaround, Robert!
rph
 
Posts: 75
Joined: Wed Aug 10, 2011 11:44 am
Location: Cham, Switzerland


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests