Window Data Type

Official Content
This documentation is valid for:

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.

Description

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

Properties

Autoresize
Height
Left
Object
Position
Top
URL
Width
Object

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.
URL

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)
Autoresize

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.

Height

Indicates the height of the popup window to be opened. This property is considered only if Autoresize = False.

Width

Indicates the width of the popup window to be opened. This property is considered only if Autoresize = False.

Position

Indicates the position of the popup window to be opened. Possible values are 1 (Absolute) or 0 (Centered)
Default value : 0 (Centered)

Top

Indicates the top position of the popup window to be opened. This property is considered only if Position = 1 (Absolute)

Left

Indicates the left position of the popup window to be opened. This property is considered only if Position = 1 (Absolute)

Methods

Open

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.

Considerations:

  • 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.

Examples

The following code:

Event 'OpenInformation'
    &window.Object = AirlineList.Create()
    &window.Open()
EndEvent

Will have the following behavior:

Popup command - Sample

and the following code:

Event 'OpenGoogle'
    &window.URL = 'http://www.google.com'
    &window.Open()
EndEvent

The following behavior:

Window data type - Sample2

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.

Scope

Objects: Web Panel object, Transaction objectWeb Component objectProcedure object
Languages: Java, .NET, Ruby (up to GeneXus X Evolution 3)
Interfaces: Web

 





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.