Difference between revisions of "Inputs in Grids within Grids"

From GXtest Wiki
Jump to: navigation, search
(Página nueva: category: GXtest guides == SetGridContext Command == parameters: * OutputContext * InputContext * Grid * SelectionRule == Example == * '''SetGridContext''' () ** Outp...)
 
Line 1: Line 1:
 
[[category: GXtest guides]]
 
[[category: GXtest guides]]
  
 +
There are applications with grids within grids. This is allowed with GeneXus through FreeStyleGrid.
 +
For these situations GXtest don't record the actions of those fields within the grid included in the parent grid, so it is necessary to add the commands manually.
 +
 +
For this there is SetGridContext command. It allows creating a grid context which provides a selection criteria for a grid. This command can be used consecutively and concatenated to have various levels of inclusion.
  
 
== SetGridContext Command ==
 
== SetGridContext Command ==
parameters:
+
SetGridContext command has the following parameters:
* OutputContext
+
* OutputContext (type variable): This variable will return the context of the grid. This context is built from the other parameters. Then this variable is a context which will be used in the commands that perform actions that are in control grids within grids.
 
+
* InputContext (Variable type is optional): This input is a context that can be used to mount the new context. When an action needs to be done in several nested grids you need to use this field.
* InputContext  
+
* Grid (type Control): grid on which it will set the context.
 
+
* SelectionRule: selection criteria for the grid Grid.
* Grid
+
 
+
* SelectionRule  
+
 
+
  
 
== Example ==
 
== Example ==
 +
Say you have a page which lists in a grid all the invoices and each invoice within its lines are listed.
 +
In that example, suppose the grid that lists the bills and called GridFactuas that has the lines of each bill is called GridFacturasLineas. Then suppose you need to do two checks with the command VerifyControlTextTable on FacturaLineaMonto and FacturaLineaCantidad fields.
  
 
+
To perform these validations should use the following commands:
 
+
* SetGridContext (context ContextoGrillaFacturas allows me to execute commands on the first row of the grid of invoices)
 
+
** OutputGrid = ContextoGrillaFacturas
* '''SetGridContext''' ()
+
** InputGrid = (empty)
** OutputGrid=ContextoGrillaFacturas
+
** Grid = GridFactuas
** InputGrid=( )
+
** SelectionRule = ByRow (1)
** Grid=GridFactuas
+
* SetGridContext (context ContextoGrillaFacturasLineas allows me to execute commands on the first line of the first bill)
** SelectionRule=ByRow(1)
+
** OutputGrid = ContextoGrillaFacturasLineas
* '''SetGridContext''' ()
+
** InputGrid = ContextoGrillaFacturas
** OutputGrid=ContextoGrillaFacturasLineas
+
** Grid = GridFactuasLineas
** InputGrid= ContextoGrillaFacturas
+
** SelectionRule = ByRow (1)
** Grid=GridFactuasLineas
+
* VerifyControlTextTable (now the command tells you to use the appropriate context)
** SelectionRule=ByRow(1)
+
Grid = GridFactuasLineas
* '''VerifyControlTextTable''' ()
+
Control = FacturaLineaMonto
** Grid=GridFactuasLineas
+
SelectionRule = ByContext (& ContextoGrillaFacturasLineas)
** Control=FacturaLineaMonto  
+
VerifyControlTextTable (now the command tells you to use the appropriate context)
** SelectionRule=ByContext(&ContextoGrillaFacturasLineas)
+
Grid = GridFactuasLineas
* '''VerifyControlTextTable''' ( )
+
Control = FacturaLineaCantidad
** Grid=GridFactuasLineas
+
SelectionRule = ByContext (& ContextoGrillaFacturasLineas)
** Control= FacturaLineaCantidad  
+
Once the framework was built, the same can be used for all commands you want.
** SelectionRule=ByContext(&ContextoGrillaFacturasLineas)
+

Revision as of 18:25, 10 March 2010


There are applications with grids within grids. This is allowed with GeneXus through FreeStyleGrid. For these situations GXtest don't record the actions of those fields within the grid included in the parent grid, so it is necessary to add the commands manually.

For this there is SetGridContext command. It allows creating a grid context which provides a selection criteria for a grid. This command can be used consecutively and concatenated to have various levels of inclusion.

SetGridContext Command

SetGridContext command has the following parameters:

  • OutputContext (type variable): This variable will return the context of the grid. This context is built from the other parameters. Then this variable is a context which will be used in the commands that perform actions that are in control grids within grids.
  • InputContext (Variable type is optional): This input is a context that can be used to mount the new context. When an action needs to be done in several nested grids you need to use this field.
  • Grid (type Control): grid on which it will set the context.
  • SelectionRule: selection criteria for the grid Grid.

Example

Say you have a page which lists in a grid all the invoices and each invoice within its lines are listed. In that example, suppose the grid that lists the bills and called GridFactuas that has the lines of each bill is called GridFacturasLineas. Then suppose you need to do two checks with the command VerifyControlTextTable on FacturaLineaMonto and FacturaLineaCantidad fields.

To perform these validations should use the following commands:

  • SetGridContext (context ContextoGrillaFacturas allows me to execute commands on the first row of the grid of invoices)
    • OutputGrid = ContextoGrillaFacturas
    • InputGrid = (empty)
    • Grid = GridFactuas
    • SelectionRule = ByRow (1)
  • SetGridContext (context ContextoGrillaFacturasLineas allows me to execute commands on the first line of the first bill)
    • OutputGrid = ContextoGrillaFacturasLineas
    • InputGrid = ContextoGrillaFacturas
    • Grid = GridFactuasLineas
    • SelectionRule = ByRow (1)
  • VerifyControlTextTable (now the command tells you to use the appropriate context)

Grid = GridFactuasLineas Control = FacturaLineaMonto SelectionRule = ByContext (& ContextoGrillaFacturasLineas) VerifyControlTextTable (now the command tells you to use the appropriate context) Grid = GridFactuasLineas Control = FacturaLineaCantidad SelectionRule = ByContext (& ContextoGrillaFacturasLineas) Once the framework was built, the same can be used for all commands you want.