Constructor
new module:argos/_LegacySDataEditMixin()
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 |
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.
Returns:
SData entry/payload
- Type
- Object
createEntryForInsert(values) → {Object}
Takes the values object and adds in $name
Parameters:
Name | Type | Description |
---|---|---|
values |
Object |
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 |
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
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)
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 |
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 |
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. |
onRequestDataSuccess(entry)
Handler when a request to SData is successful, calls processEntry
Parameters:
Name | Type | Description |
---|---|---|
entry |
Object | The SData response |
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. |
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. |
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 |
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 |