Class: _LegacySDataEditMixin

_LegacySDataEditMixin()

Enables legacy SData operations for the Edit view.

Constructor

new _LegacySDataEditMixin()

Source:

Methods

convertValues(values) → {Object}

Does the reverse of convertEntry in that it loops the payload being sent back to SData and converts Date objects into SData date strings
Parameters:
Name Type Description
values Object Payload
Source:
Returns:
Entry with string dates
Type
Object

createEntry() → {Object}

Gathers the values for the entry to send back to SData and returns the appropriate create for inserting or updating.
Source:
Returns:
SData entry/payload
Type
Object

createEntryForInsert(values) → {Object}

Takes the values object and adds in $name
Parameters:
Name Type Description
values Object
Source:
Returns:
Object with added properties
Type
Object

createEntryForUpdate(values) → {Object}

Takes the values object and adds in $key, $etag and $name
Parameters:
Name Type Description
values Object
Source:
Returns:
Object with added properties
Type
Object

createRequest() → {Object}

Creates Sage.SData.Client.SDataSingleResourceRequest instance and sets a number of known properties. List of properties used `this.property/this.options.property`: `entry['$key']/key`, `contractName`, `resourceKind`, `querySelect`, `queryInclude`, and `queryOrderBy`
Source:
Returns:
Sage.SData.Client.SDataSingleResourceRequest instance.
Type
Object

getContext()

Extends the getContext function to also include the `resourceKind` of the view, `insert` state and `key` of the entry (false if inserting)
Source:

onInsertFailure(response, o)

Handler for when instert() fails, enables the form and passes the results to the default error handler which alerts the user of an error.
Parameters:
Name Type Description
response
o
Source:

onInsertSuccess(entry)

Handler for when insert() is successfull, publishes the global `/app/refresh` event which forces other views listening for this resourceKind to refresh. Finishes up by calling onInsertComplete.
Parameters:
Name Type Description
entry
Source:

onRequestDataFailure(response, o)

Handler when an error occurs while request data from the SData endpoint.
Parameters:
Name Type Description
response Object The response object.
o Object The options that were passed when creating the Ajax request.
Source:

onRequestDataSuccess(entry)

Handler when a request to SData is successful, calls processEntry
Parameters:
Name Type Description
entry Object The SData response
Source:

onRequestFailure(response, o)

Handler when an error occurs while request data from the SData endpoint.
Parameters:
Name Type Description
response Object The response object.
o Object The options that were passed when creating the Ajax request.
Source:

onUpdateFailure(response, o)

Handler when an error occurs while request data from the SData endpoint.
Parameters:
Name Type Description
response Object The response object.
o Object The options that were passed when creating the Ajax request.
Source:

onUpdateSuccess(entry)

Handler for when update() is successfull, publishes the global `/app/refresh` event which forces other views listening for this resourceKind to refresh. Finishes up by calling onUpdateCompleted.
Parameters:
Name Type Description
entry
Source:

processEntry(entry)

Handles the SData response by converting the date strings and storing the fixed extry to `this.entry` and applies the values.
Parameters:
Name Type Description
entry
Source: