<x:deleteRow>

An x:deleteRow action is used to delete a row in a result set produced using the x:select action from the database.

The same connection information referenced in the x:select action will be used for the x:deleteRow action.

By default, this action deletes the current row. However, see the description of the rows attribute below for usages in which other rows can be deleted. If the row to be deleted is not the current row, any changes in the current row are first applied to the database. The row after the deleted row becomes the current row at the end of the action.

This action changes the numbering of all rows after the deleted row unless it occurs inside the x:batch action, in which case the numbering does not change until the end of the x:batch.

 

Syntax

<x:deleteRow         name = "target bean name"
                row = "rowNumber" />

The x:deleteRow action has the following attributes:

name

The name of the DBSelect bean containing the result set from which a row will be deleted. The value is case sensitive and must match a Select variable that is in scope. This attribute is required unless the action is (directly or indirectly) inside the body of an x:repeat for which the name attribute has been specified. In that case, the name attribute defaults to the same value specified in the closest containing x:repeat.

row

The row number to be deleted. (A value of 1 refers to the first row.) This attribute is optional. If it is not specified, the default value depends on whether this action is inside the body of an x:repeat with over="rows" specified. If so, the value of the index variable for that x:repeat will be used. If not, the index of the current row of the result set will be used.

Using the x:deleteRow action makes the row after the deleted row the current row. The action changes the numbering of all subsequent rows unless it occurs inside the x:batch action, in which case the numbering does not change until the end of the x:batch.

 

Examples

This example deletes row 5 (the 6th row) from the result set.

<x:deleteRow name="select1" row="5" />