I'm displaying a VLWEB Webpage in a javascript popup window.
var url = "/dc-pgmlib/TST/mypage.html";
.
.
var opt = "width=900,height=600,directories=no,toolbar=no,";
opt += "menubar=no,scrollbars=yes,resizable=yes,location=no,status=no";
var win;
win = window.open(url,'examtimetable',opt,true);
A window popped up like this can contain javascript to close itself from a button with;
window.close();
It is also able to call function in its parent, passing parameters back with:
self.opener.JPopUpAssign(actionStatus, selectionKey);
Does anyone know how to accomplish this from a VLWEB webpage?
VLWEB in Popup Window
Re: VLWEB in Popup Window
while it will be awesome to have something like this:
what we currently have, is widgets. Lets say I create a new widget , i called it rauljavascriptfunctions, as object (no control which means that I dont need anything to show in the screen), then add a method in the definition tab (right button in the method section of the widget) and it will look like this:

then you copy this sample code in the left to the implementation section of the widget and add the window.close() ... dont need to look or touch the rest :
Compile it. Then you go to your LANSA webpage, drag and drop the widget there, and when you need it, just call the windowclose method in your widget. and voala, it works correctly.

You can add the rest of javascript functions in the same way to the widget, with parameters send from the webpage, properties if you need, etc.

Code: Select all
#sys_web.javascript( 'window.close();' )
then you copy this sample code in the left to the implementation section of the widget and add the window.close() ... dont need to look or touch the rest :
Code: Select all
//-------------------------------
// WIDGET-PROPERTY IMPLEMENTATION
//-------------------------------
//
// windowclose - Close a Windows
//
// Return Type: Boolean
//
PROTOTYPE.windowclose = function()
{
// Implementation...
window.close();
return false;
}
You can add the rest of javascript functions in the same way to the widget, with parameters send from the webpage, properties if you need, etc.

-
jimwatterson
- Posts: 56
- Joined: Thu Jul 09, 2020 8:31 am
Re: VLWEB in Popup Window
Thanks Dino, that's a very comprehensive answer. I'll give it a go. I suspected it might be a widget issue but I was hoping there might be something built in that I had missed.
-
jimwatterson
- Posts: 56
- Joined: Thu Jul 09, 2020 8:31 am
Re: VLWEB in Popup Window
I've just implemented the windowclose method and it worked out of the box!
Thanks again.
(Good to see a bit of activity on this forum)
Thanks again.
(Good to see a bit of activity on this forum)
-
jimwatterson
- Posts: 56
- Joined: Thu Jul 09, 2020 8:31 am
Re: VLWEB in Popup Window
Just to finish on a high - the NotifyParent window worked out of the box too.
Its Friday evening here, a good time to knock off and go for a beer!
Its Friday evening here, a good time to knock off and go for a beer!