Running NG-Client inside another system?

Forum to discuss the new web client version of Servoy.

Running NG-Client inside another system?

Postby swingman » Thu Sep 03, 2020 4:41 pm

Hi all,

I have been asked whether I can place Servoy screens inside a web-tab or iFrame inside another management system.
The idea would be to make servoy show additional details relating to the screen you are on in the main system, by passing a pk or uuid to Servoy.

I see a page from 2012 about running the web-client in an iFrame, but nothing about the NG-Client.
Have anyone done anything like this?

Christian
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Running NG-Client inside another system?

Postby swingman » Fri Sep 04, 2020 11:40 am

OK, I seem to have found it -- deep linking.

I have tested this in a locally by running Servoy developer and a web app (in my case a Rails app) inserting

Code: Select all
<div style="position: relative; top: 0px; bottom: 0px; height: 800px; left: 0px; right: 0px; margin-top: 10px; margin-left: 10px; margin-right: 10px;">
    <iframe src="http://localhost:8080/solutions/mysolutionname/index.html?m=gosomewhere&a=<%= some_id %>" height="100%" width="100%" frameborder="0"></iframe>
  </div>


In my Servoy app I have a method in the global scope:

Code: Select all
function gosomewhere(param) {
   var id = parseInt(param);
   //startup method does not called when deep linking, so call it if need be

   //my code here to show the correct screen.
}
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Running NG-Client inside another system?

Postby mboegem » Fri Sep 04, 2020 10:58 pm

Hi Christian,

in your sample you mention the startup method is not called, but I think this is partly true.

If you open the solution for the first time, I believe the onSolutionOpen is triggered.
However, when you deeplink a 2nd time (in this case a solution session already exists for the browser session), the onSolutionOpen will not be triggered.

Another reason why onSolutionOpen may not be triggered in developer, is when you deeplink into a module of the main solution.

Both cases are the main reason why - like you did - a global method should be used to handle the parameters.

Hope this helps.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1742
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Running NG-Client inside another system?

Postby swingman » Sun Sep 06, 2020 5:05 pm

Thanks Mark, I will check this again.

The comment about onSolutionOpen was my rephrasing of something I had seen on the forum or in an example and may no longer be how Servoy is working.

It is neat how the browser session persists, making Servoy seem an integral part of the host system. With some matching CSS styling the users will have no idea of that it is a separate system.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests

cron