Page 1 of 1

IFRAME AND HYPERLINK TARGET IN PROFOUNDUI

Posted: Fri May 30, 2014 6:30 am
by chdiop
I am building a new application. In the page displaying the menu there are two hyperlink and an iframe in the center of the page.
I want that hyperlink target be the iframe content. how to do is with Profoundui (and RPG)? Thanks for your advanced posts.

Re: IFRAME AND HYPERLINK TARGET IN PROFOUNDUI

Posted: Fri May 30, 2014 12:16 pm
by Scott Klement
There are two alternative ways:

1) If no RPG logic is needed (database access or whatnot) you can do this entirely in the JavaScript of the display file.

Make sure nothing is assigned to the 'response' element of the hyperlink. Then, set the 'onclick' property to something like this:

Code: Select all

applyProperty("id-of-iframe", "iframe url", "http://www.profoundlogic.com");
applyProperty("id-of-iframe", "field type", "iframe");
The first line changes the URL of the iframe. The second line forces the iframe to re-render (re-draw itself on the screen.) Most Profound UI widgets draw themselves when their field type is altered, so setting the field type (to the same value it already had) makes it re-draw.

Repeat this process for each hyperlink you want to use to control the iframe.


2) If RPG logic is wanted/needed, bind an indicator to the 'response' property of the hyperlinks, and bind a character field to the "iframe url" property of the iframe. When the user clicks the link, control will return from the EXFMT... the RPG code can then check the hyperlink indicators, and if one is turned on, set the iframe URL accordingly. When you EXFMT the screen again, it'll show the iframe pointing to the link... nice thing about doing this in the RPG code is that you can use any method you want in the RPG code to calculate the iframe URL (including database lookups, etc.)

Good luck

Re: IFRAME AND HYPERLINK TARGET IN PROFOUNDUI

Posted: Wed Jun 04, 2014 4:13 am
by chdiop
Thanks your advanced responses. I will try to do one of these methods.