English|Português|Español
UserPasswordLogin

HOME
SESSIONS
INFO
Imagen6379E

Web Grid Selection

As from GeneXus 8.0 RC, it is possible to implicitly select a Web grid line; this feature facilitates Windows-to-Web migration.

Scope
Objects: Transactions, Web Panels
Languages: .NET, C/SQL, Visual Basic, Java
Interface: Web

Introduction
Up to now, it wasn't possible to select a line from the grids used in web objects (web interface transactions, web panels). However, as from GeneXus 8.0 Release Candidate, any line from a web grid may be selected and used in an operation.
It is also possible to highlight the background of a grid's line when the cursor runs through them.

Description
This feature is useful to use Web Panels in the same way Work Panels are used in Windows interface applications ("Work with..."). This means that once the line is selected, the web interface transactions may be called in the different modes allowed by GeneXus to create, modify or delete records from the Transaction.
In previous versions, this was not possible. Users had to find ways to program it, for instance, by implementing a link in one of the grid's fields, calling a transaction associated in ?Update' mode. But what should we do to call it in 'Delete' or 'Display' mode. In these cases, users used to solve this in different ways.
This feature has solved the problem and now it is easier to migrate from Windows to Web, since you can continue to program in the same way you did in Windows. Besides facilitating migration, this also offers a wider range of programming possibilities for dialog programming for the Web, as shown in the example below that is also available in GXOpen (http://www.gxopen.com/hproject.asp?122).

In order to set this feature, the design mode has a set of properties that you can use inside the Selection section:

The following properties have been set to select a line in a Web grid:

AllowSelection
Values
True ? It specifies that it is possible to select a line in the grid.
False - Does not allow to select a grid's line.
Default Value = False

SelectionColor
The background color used for a selected line, when the AllowSelection property is True.
To select a color, click the ellipsis button  
Default Value = Ultra Light Cyan

AllowHovering
Values
True ? Specifies that the grid's lines background will be painted when the cursor runs on them.
False ? Does not allow painting the background of a grid's line.
Default Value = True

HoveringColor
Color used for painting the background of a line on which the cursor is positioned, when the selected AllowHovering property is True.
To select a color click the ellipsis button
Default Value = Cyan

Example

In the following figure, we show the execution of a Web object with the AllowSelection = True and AllowHovering =True properties.

Notes about the figure:
- The selected line is '9' (the color results from this configuration: ).

- The mouse is positioned on line '7' (the color results from this configuration:).

Considerations
These properties are available in design mode at the grid level inside the Appearance/Selection group, and also at execution time. For instance, in an event you may have:

Event 'Selection'
grid1.AllowSelection = 1
EndEvent

Upon event execution, it will be possible to select a grid's lines. Depending on the value of the grid's AllowHovering property, the lines will or will not be painted when the cursor runs through them.

The colors that will be used in both cases are those configured in the grid's properties.

There is no support for multiple selection; it is only possible to select one line at a time.

This characteristic applies for Web applications executed in Internet Explorer 5.5 or higher, and in Netscape 6.X or higher.

Related
From GeneXus 8.0 RC: Structured Data Types (SDT)
From GeneXus 8.0 RC: Structured Data Types (III)
From GeneXus 8.0 RC: Collapsible Grids
From GeneXus 8.0 RC: Option Distinct Clause
From GeneXus 8.0 RC: Auto-numbering Property
From GeneXus 8.0 RC: Transactions as Web Components