sap.ui.generic.app.transaction.DraftController.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.generic.app.transaction.DraftController with name
sClassName
and enriches it with the information contained in
oClassInfo
.
oClassInfo
might contain the same kind of information as described in Object.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.generic.app.transaction.DraftController.
Returns:
activateDraftEntity(oContext): Promise
Submits changes to the back-end and activates a draft entity in the back-end.
Parameters:
Returns:
{Promise} | A Promise for asynchronous execution |
createEditDraftEntity(oContext, bPreserveChanges?): Promise
Creates an edit draft in the back-end. Additionally, possible changes that have been collected on the client are sent to the back-end.
Parameters:
{sap.ui.model.Context} | oContext | The given binding context |
{boolean} | bPreserveChanges? | Set to true to avoid the creation of a new draft when unsaved changes exist in the back-end |
Returns:
{Promise} | A Promise for asynchronous execution |
createNewDraftEntity(sEntitySet, sPath): Promise
Creates a new edit draft on the client and sends it to the back-end. Additionally, possible changes that have been collected on the client are sent to the back-end.
Parameters:
{string} | sEntitySet | The name of the entity set |
{string} | sPath | Path identifying the new entity instance |
Returns:
{Promise} | A Promise for asynchronous execution of the request |
destroy()
Frees all resources claimed during the life-time of this instance.
Returns the current draft context instance. If no instance exists, it is created lazily.
Returns:
getDraftForActiveEntity(oContext): Promise
Retrieves a possibly existing draft entity for the given active entity using the binding context of the active entity from the back-end.
Parameters:
- Since:
- 1.32.0
Exceptions:
{Error} | Throws an error if no context is handed over as input parameter |
Returns:
{Promise} | A Promise for asynchronous execution |
hasActiveEntity(oContext): boolean
Checks whether an entity has an active entity associated.
Parameters:
- Since:
- 1.32.0
Returns:
{boolean} | true , if an active entity exists, false otherwise |
isActiveEntity(oContext): boolean
Checks whether an entity set is active. The entity set name is derived from the given binding context
Parameters:
Exceptions:
{Error} | Throws an error if no context is handed over as input parameter |
Returns:
{boolean} | true , if a given entity set is active, false otherwise |
prepareDraftEntity(oContext): Promise
Submits changes to the back-end and prepares an existing draft entity in the back-end for later activation by invoking the preparation action.
Parameters:
Returns:
{Promise} | A Promise for asynchronous execution |
saveAndPrepareDraftEntity(oContext, mParameters): Promise
Submits changes to the back-end and prepares a draft entity in the back-end for later activation by invoking the preparation action.
Parameters:
{sap.ui.model.Context} | oContext | The given binding context |
{map} | mParameters | Parameters to control the behavior of the request |
Returns:
{Promise} | A Promise for asynchronous execution |
validateDraftEntity(oContext): Promise
Submits changes to the back-end and prepares an existing draft entity in the back-end for later activation by invoking the validation action.
Parameters:
Returns:
{Promise} | A Promise for asynchronous execution |