This class displays detailed information about a single customer in the
client database. The information can be edited. If the data is changed and
the Submit button is pressed, the buttonPressed method uses Object API calls
to save the changes in the client database, send the changes to the server,
and disable the Submit button.
If the server accepts the changes, the callback handler posts an
ON_REPLAY_SUCCESS notification, which causes the onReplaySuccess
notification handler to run. The cached UI data is refreshed from the
database and the Submit button is re-enabled.
This class also registers for the ON_REPLAY_FAILURE notification to handle
the case where the server rejects the changes, or an error occurs on the
server side.
If you press the Delete button, the
buttonPressed method uses the Object API calls to
delete the record and then initiates a synchronize to send the delete
request to the server. If the server accepts the changes, the callback
handler posts an ON_REPLAY_SUCCESS notification and the list page is shown.
If the Create option is selected from the menu list, the DetailController is
loaded with an empty form. The Submit button is called Create. If you fill
out the form and press the Create button, a new
record is created in the local database and a synchronization call is
initiated. If the server accepts the new record, an ON_REPLAY_SUCCESS
notification will be posted.