Adding local html page

Forum to discuss the new web client version of Servoy.

Adding local html page

Postby vantesterwalter » Wed Mar 29, 2017 10:05 am

Hi

I'm new to Servoy and I'm struggling to see a local html page in the NG client.
Can someone show me an example?

Also I need to interact with this page.
Is there a way to gain data from this html page like with the JFXWebView?

Thanks,
Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby rvanderburg » Wed Mar 29, 2017 9:51 pm

Can you share what you are trying to do? Is this local HTML file, local on the machine of the end user?
JFXWebView is smartclient not NG client.
rvanderburg
Site Admin
 
Posts: 78
Joined: Wed May 04, 2011 10:28 am

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 8:27 am

Hi

I'm going to try to explain myself a bit more.

I made a Javascript project and this is working just fine.
This project is fully compatible with the smart client.
I used JFXWebView to achieve this compatibility.

Now I'm trying to do the same for the NG client.

Question:
In the smartclient with i'm using the JFXWebView.
This puts my project into an Tabless panel to work with.
How can you achieve the same effect in the NG client?

I hope this explains it better.

Thanks,
Walter
Last edited by vantesterwalter on Fri Mar 31, 2017 2:38 pm, edited 1 time in total.
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby patrick » Thu Mar 30, 2017 10:21 am

Now you are explaining what you are doing, but not what you are trying to accomplish ;-). Could you explain a bit what you want to solve with this approach before we start discussing a technical solution for something that maybe should be approached completely different. What is the user story here?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 10:48 am

Hi

I want to make use of the NG client.
The thing I need is a way to load in my already made Javascript project into the NG client so I can work with it.

I used the example of the JFXWebView in the smart client to show what I want to achieve in the NG client.
The problem I have is that I don't know how to show my already made Javascript project in the NG client.

Thanks,
Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby patrick » Thu Mar 30, 2017 10:53 am

And what does that js project do?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Adding local html page

Postby rvanderburg » Thu Mar 30, 2017 11:00 am

What you are trying to do sounds like you want to embed an iframe into an NG client, thats pretty simple. I trying to understand why you want to do this. Where is the javascript you already made running, how will you deploy this?
To embed an iframe in NG you can just make your own simple webcomponent that has an iframe in it. In your solution node got to web packages, create component package project, in that package do create new component. Below you see the html file created. Now when you edit that you can add an iframe to it. The URL you want to point to you can hard code for now but potentially you can make that a design time property through the spec file.
Now when you add this iframe to your form it will show an iframe with the contents of the URL of the iframe.
rvanderburg
Site Admin
 
Posts: 78
Joined: Wed May 04, 2011 10:28 am

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 11:02 am

Hi

This project is kind of a game you can play on your browser.
You can start this game by going to the local html file: file:///C:/Users/walter/Documents/tests/playground.html
I made this work in the smart client by using that link and i'm hoping I can do this with the NG client as well.

Thanks,
Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 11:19 am

Hi rvanderburg

I already tried this.
What happens then is that when I watch my code in the form editor, I can see my webpage, but when I start up the NG client it only shows white.

Thanks,
Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby patrick » Thu Mar 30, 2017 11:24 am

Makes it clearer, thanks.

NG client runs in the browser and the actual Servoy client runs on the server. So this

file:///C:/Users/walter/Documents/tests/playground.html

will not be possible, because you can't access the file system like that from a browser.

Without knowing a bit more about what your game looks like, it's hard to say what the best solution is. Running in the browser means you are inside an html page already and you can't have two, unless you use an iframe. Probably, the "NG way" of doing this would be to wrap your game in a web component (see https://wiki.servoy.com/display/DOCS/WebComponents) that you can place where you like, call code in it and handle callbacks. Simply "injecting" your page could be more tricky, but that highly depends on what your thing looks like. In the smart client this appears more straight forward, but that is because every jfxpanel is its own browser (html page). With NG (or Web) client you are already in an html page...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 11:41 am

Hi Patrick

Thanks for the great response, with this I can work.
I already went through the webcomponents doc and I don't understand how to wrap my project.
Do you have any tips?

Thanks,
Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am

Re: Adding local html page

Postby patrick » Thu Mar 30, 2017 12:22 pm

I couldn't write more here than the Wiki link and its sub pages can tell you. Maybe it helps to look at existing components. We have several component projects on github where source code is available.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Adding local html page

Postby vantesterwalter » Thu Mar 30, 2017 1:01 pm

Hi Patrick

Thanks for your responses.

Walter
vantesterwalter
 
Posts: 16
Joined: Wed Mar 29, 2017 9:46 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 9 guests