<invantive:foreach>...</invantive:foreach> |
Sequences from the Model
With <invantive:foreach>...</invantive:foreach> you can repeat a sequence, every time again with different values for the variables. This instruction can be added easily with Building Block.
An example of <invantive:foreach>...</invantive:foreach>:
•<invantive:foreach block="cde" />: supplies subsequently the data from the block cde that is described in the model.
Apart from the block, you can also enter an alias to later use with the <invantive:value-of>. If no alias is specified, the alias will be the sames as the value for "block".
SQL Sequences
Some sequences can not be easily described in the model. That is why with Invantive Composition you can also describe sequences in free text as SQL:
•<invantive:foreach query="select gbr_naam from bubs_gebruikers_v" />: provides successively each person's name from the system.
•<invantive:foreach query="select gbr_naam from bubs_gebruikers_v where gbr_naam = $P{p_naam} order by gbr_naam" />: provides successively every person's name from the system, which is equal to the value of the parameter p_naam, sorted by name.
•<invantive:foreach alias="gbr" query="select gbr_naam from bubs_gebruikers_v" />: successively provides each person's name from the system. These data can also be requested from <invantive:value-of> by entering the alias in front of the field code.
The queries you can use '*' to retrieve all fields. With <invantive:value-of> you still need to specify the exact field name.