zondag 13 november 2011

Sample for iframe on DSP

If you want to show a non-Uniface web page in your new Uniface 9.5 DSP application, there is a simple solution.

In this sample I will show you how it can be done using an iframe. My example consists of a single DSP with a field where you can enter a URL and two buttons to demonstrate two possible techniques to show the page.

First we make an iframe in the HTML source in the layout editor:
Next we write a weboperation that takes an URL as parameter and puts it in the iframe:
The first button uses Uniface Proc code to call the weboperation with the value of the field. This causes a trip to the server, but you can use this code as sample to call the webopration from anywhere in Uniface:
The second button uses JavaScript code in a webtrigger to call the weboperation with the value of the field. Now everything is executed on the browser:
This is how your screen should look like when you have loaded Uniface.info:

NB: Unfortunately not every web page wants to be in an iframe, but this works for most.

Geen opmerkingen:

Een reactie posten