OnViewSaved - cWebView

Sent to the view after a successful save

Type: Event

Parameters: Handle hoDDO Boolean bChanged

ParameterDescription
hoDDOHandle of the DataDictionary object (DDO) that performed the save
bChangedTrue if DDO was changed. When False, it means a save was requested but nothing was done, which is considered a successful save.


Syntax
Procedure OnViewSaved Handle hoDDO Boolean bChanged

Description

OnViewSaved is sent after a successful view save (Request_Save). A save is successful if the save was error free. This would include a save where there was no changes and hence nothing to save.

The events OnViewSaved, OnViewDeleted and OnViewCleared provide hooks where you can do things like: close the view after a save or delete, change edit mode, or possibly change buttons and captions.

These events are particularly useful with mobile style applications (peWebViewStyle is wvsDrillDown). With drilldown style applications, we recommend that you not set pbClearAfterSave to True. cWebView already sets this to False when peWebViewStyle is wvsDrillDown. Instead, you should use OnViewSaved to decide what to do next.

// this closes the view after a successful save
Procedure OnViewSaved Handle hoDDO Boolean bChanged
    Send NavigateClose Self
End_Procedure

Note that this is sent as part of Request_Save and not sent if Request_Save is sent directly to the DDO.


If you set pbClearAfterSave to False and don't close a cWebView after saving, you probably want to send ChangeEditMode False from OnViewSaved, so that after a save, edit mode is disabled again until the user endables it again.

Procedure OnViewSaved Handle hoServer Boolean bChanged
    // re-disable edit mode
    Send ChangeEditMode False
End_Procedure