Visible property: Row class
Description
If this property is True, the row is visible if displayed on the current page. This property can be set False to hide the row.
When Visible is set to False to hide a row, the row moves to the end of the rowset. This means that the row number of the row being hidden, and any subsequent rows, changes as a result of hiding a row. If the row is later made visible again, it is not moved back to its original position, but remains at the end of the rowset. It is just moved to the start of all the other hidden rows.
For example, if there are 4 rows in a rowset and row 2 is hidden (that is, Visible = False), that row now becomes row 4. In order to make that row visible again, row 4 must be set to Visible = True. Alternatively, you can use a row object reference: this remains valid even though the row number of the row may have been changed.
Note:
If you use the Sort method on a rowset with hidden rows, the hidden rows aren't sorted. Only visible rows are sorted.
You cannot hide rows in the current context of the executing program. This means Visible cannot hide the row containing the executing program, or in a child rowset and be executed against its parent rowset. Place your PeopleCode in a parent rowset and execute it against a child rowset.
Example
&ROW.Visible = False;
The following code uses the Visible property to determine if a row is visible or not before updating the value of the row.
&ROWSET = GetRowset(SCROLL.LD_SHP_INV_VW)
For &I = 1 To &ROWSET.ActiveRowCount
If &ROWSET(&I).Visible Then
ITEM_SELECTED.value = "N";
End-If;
End-For;
The following code starts with the last row and works forward to the first. If any changes are made they don't impact the position of rows that still have to be processed.
For &I = &ACTIVE_STREAMS to 1 Step -1
&Row = &STREAM_ROWSET(&I);
If &Row.QS_STREAM8.STREAM_ROOT_ID.Value <> &STREAM_ROOT_ID Then
&Row.Visible = False;
End-if;
End-For;