company logo

Line :: attach - Attach list item to line

The function attaches a list item from a table or tree to the Line object. When required line could not be located in tree, list or table, the function returns an invalid line. In order to check, whether the line is valid, one may call Line ::isValid() .

Implementation overview

Implementation details

  1. Attach to list item with given column value
    Line  :: attach ( odaba::String &sValue, int32 iPosition )

    The function attaches the list item that contains the value passed in sValue in column at position iPosition (first column is 0 ) to the line. When no such item exists, the function returns an invalid line.

    • sValue - String value
    • iPosition - Position in collection

      The position of an entry in a collection or list is the number of the entry in the collection beginning with 0 for the first entry.

  2. to list
  3. Attach currently selected list item
    Line  :: attach (  )

    The function attaches the currently selected list item to the line. When no item is selected in the list, the function returns an invalid line.

  4. to list
  5. Attach list item with given key value
    Line  :: attach ( odaba::String &sValue )

    The function attaches the list item with with the key value passed in sKey to the line. When no such list item exists, the constructor returns an invalid line.

    Usually, the list item key is identical with the value in the first column. When, however, changing the order in the list, the key might be associated with another column (order column).

    • sValue - String value
  6. to list
  7. Attach list item by instance identifier (LOID)
    Line  :: attach ( int64 iLOID, bool bRecursive )

    The function attaches list item with with the database instance identifier (LOID) passed in iLOID . When no such item exists, the function returns an invalid line.

    When passing true in bRecursive , the LOID is searched also in all sub-regions.

    • iLOID - Instance identifier

      Local object instance identifier (LOID) are numbers, which uniquely identify an object instance in the database.

    • bRecursive - Call function recursively
  8. to list
  9. Attach item at position
    Line  :: attach ( int32 iPosition )

    The function attaches the line at position passed in iPosition . When the control is a tree, the row position is located on top level ignoring items in lower levels. The function cannot be used for locating items on lower levels. When the requested line could not be located, the function returns an invalid line.

    In order to attach the last line in a list, -1 may be passed in iPosition .

    ... toBottom (ControlContext &ctx) {

      Line(ctx,-1).setCurrent(); // set to last lint in top region

    }

    • iPosition - Position in collection

      The position of an entry in a collection or list is the number of the entry in the collection beginning with 0 for the first entry.

  10. to list