The Window data type allows opening an object or an external URL in a popup window. If the page called is in the same server as the caller page, the popup will be opened in modal status, which means that it blocks the parent application until the user closes it in any way.
To open a popup window from any web object, a Window data type variable should be defined. Afterwards, some information must be indicated, such as an object (Web Panel, Transaction, HTTP Procedure) or a URL to be opened. The popup window will be opened in modal status (like GX prompts), except when the web page indicated to be opened is in a server other than that of the caller page. In such cases, a new window will be opened and both (caller and called) will be active. In addition, some properties are available in order to indicate size and position of the popup window
Web Object to be opened in the popup window. The supported object types are as follows:
- Web Panels
- Web Components with URL Access = Yes
- Transactions (if Type = Component, URLAccess should be set to Yes in order to be supported)
- Procedures with Call Protocol = HTTP
The object is indicated using the Create command, i.e. using the following syntax:
- &Window.Object = GeneXusWebObject.Create(params)
- &Window.Object = Create(GeneXusWebObject, params)
If another object type is used to assign the Object property of a Window type variable, a specification error of the following types will be displayed.
- spc0008 Source : Call to program <GeneXusWebObject> that cannot be generated.
- spc0012 Source : Object <GeneXusWebObject> referenced in a create function must be a component.
Indicates a URL to be opened in the popup window. It admits any character value and assignment can be done using constants, attributes, variables or function results.
- &Window.URL = 'http://www.google.com'
- &Window.URL = CharAttribute
- &Window.URL = &CharVariable
- &Window.URL = link(GeneXusWebObject, params)
Indicates if the popup window will be resized to the web page content when opened. Possible values are true or false (Boolean).
Default value: true.
Indicates the height of the popup window to be opened. This property is considered only if Autoresize = False.
Indicates the width of the popup window to be opened. This property is considered only if Autoresize = False.
Indicates the position of the popup window to be opened. Possible values are 1 (Absolute) or 0 (Centered)
Default value : 0 (Centered)
Indicates the top position of the popup window to be opened. This property is considered only if Position = 1 (Absolute)
Indicates the left position of the popup window to be opened. This property is considered only if Position = 1 (Absolute)
Opens the indicated web page in a popup window. The popup window will be opened in modal status, except when the web page indicated to be opened is in a different server than the caller page. In that case, a new window will be opened and both (caller and called) will be active.
- If there are two or more assignments of URL or Object properties in an event (i.e. two URL assignments, two Object assignments or one of each), only the last one will be considered.
The following code:
&window.Object = AirlineList.Create()
Will have the following behavior:
and the following code:
&window.URL = 'http://www.google.com'
The following behavior:
As you can see, if the web page to be opened is in a different server from the caller page, the popup window is not opened in modal status (you can continue working in the caller page); in fact, a new browser instance is created.
Objects: Web Panel object, Transaction object, Web Component object, Procedure object
Languages: Java, .NET, Ruby (up to GeneXus X Evolution 3)