{dialog.object}setDirty Method





Default = false. Specifies whether or not data bound controls should be set to dirty. If the flagSetDataDirty parameter is set to true, then the UX component's _isDataDirty flag is also set to true, and the dialog.dataIsDirty system field used in Client-side watch expressions is also set to true.


Sets the UX component to be dirty.


The setDirty() method can be used to mark the UX Component as "dirty" or modified. Normally, the UX component becomes dirty automatically when the user edits the value of a control. In some situations, it may be necessary to programmatically mark the UX as dirty.

The method takes an optional parameter, flagSetDataDirty. Modified controls in the UX Component are tracked using two separate variables: _isDirty and _isDataDirty. _isDirty will be true if any control on the UX Component has been modified. _isDataDirty will only be true if a data bound control has been modified. The flagSetDataDirty parameter can be used to set the _isDataDirty variable to true, indicating that data bound controls are dirty.

In client-side expressions, you can reference these two variables using the dialog.isDirty and dialog.isDataDirty system fields.



// set the ux component and data bound controls dirty:

// set only the ux component dirty - does not set data bound controls dirty
You cannot use this method to set the UX as "clean". Use the setClean() or resetForm() methods instead.

See Also