company logo

PropertyContext :: readOnly - readOnly property

The property provides the information, whether update is allowed (false) or not (true). Since this is a context property, it may differ from the readOnly() state in the property handle, the context applies to.

The readOnly() state can be set by the application in order to prevent data from being updated (e.g. because the active user is not authorized).

Notes:

The read-only state will not be automatically reset when changing the selection for a property handle, but remains until being reset explicitly by the application.

Return value:  Success ( bool  )

The value is true when the function was executed successfully. Otherwise the value is set to false.

Implementation overview

Implementation details

  1. Get Read-only state
    bool PropertyContext  :: readOnly (  )

    The function returns whether the read only option has been set for the property (true) or not (false). The function only returns the read only state set by the type context, but not the access state of the instance, which may be read only for other reasons (e.g. write protected, read only property handle). In order to check accessibility for an instance, one may call Property::canUpdate().

  2. to list
  3. Set read-only state
    bool PropertyContext  :: readOnly ( bool bReadOnly )

    The function allows setting the collection and the instance selected in the property handle to read-only. This will prevent the data in the property handle from being updated, i.e. one cannot add or delete instances to the collection or change attribute values in the selected .

    Passing true in bReadOnly will also mark all subordinated instances and their property handles as read-only.

    Passing false in bReadOnly will reset the read-only state for the context. Resetting the read-only state works hierarchical as well, until subordinated instances or property handles are found, which are explicitly set to read-only by the application, i.e. resetting the read-only state will not reset read-only states in contexts, which have been marked explicitly by the application.

    In order to set an instance to read-only, but not the subordinated properties and related instances, BaseContext::displayState() may be called.

    • bReadOnly - Read-only option

      In order to indicate read-only state, the value is true, false otherwise.

  4. to list