Difference between revisions of "Inputs in Grids within Grids"

From GXtest Wiki
Jump to: navigation, search
(Example)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 +
{{Idiomas| Campos en Grillas dentro de Grillas| Inputs in Grids within Grids | グリッド内のグリッドへの入力}}
 
[[category: GXtest Guides]]
 
[[category: GXtest Guides]]
  

Latest revision as of 04:39, 21 February 2014

Spanish.gif
English.gif
Japan.gif

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

Imagine that you have a page which lists in a grid all the invoices and there you list every item of the invoice. In that example, suppose the grid that the invoice lists is called GridInvoices, and this grid that has the lines of each bill is called GridInvoiceLine. Then suppose you need to do two checks with the command VerifyControlTextTable on InvoiceLineAmount and InvoiceLineNumber fields.

To perform these validations you should use the following commands:

  • SetGridContext (context ContextGridInvoice allows you to execute commands on the first row of the grid of invoices)
    • OutputGrid = ContextGridInvoice
    • InputGrid = (empty)
    • Grid = GridInvoice
    • SelectionRule = ByRow (1)
  • SetGridContext (context ContextGridInvoiceLines allows you to execute commands on the first line of the first invoice)
    • OutputGrid = ContextGridInvoiceLines
    • InputGrid = ContextGridInvoice
    • Grid = GridInvoiceLines
    • SelectionRule = ByRow (1)
  • VerifyControlTextTable (now the command tells you to use the appropriate context)
    • Grid = GridInvoiceLines
    • Control = InvoiceLineAmount
    • SelectionRule = ByContext (& ContextGridInvoiceLines)
  • VerifyControlTextTable (now the command tells you to use the appropriate context)
    • Grid = GridInvoiceLines
    • Control = InvoiceLineNumber
    • SelectionRule = ByContext (& ContextGridInvoiceLines)

Once the context was built, the same can be used for all commands you want.