thisXDocument.IsDirty

M

Mattia Saccotelli

How and when this bit is changed ?
I noticed that its value is (almost) always 'true' when I perform a
SwitchView()
I have to save between view changes but the saving process is done via
web service, so it must be done only when really needed! The IsDirty
bit, being true after the SwitchView, forces the code to save
continuously, even without changes.
How to check when does this property change?

regards
 
D

Darren Neimke

Hi Mattia... I created a form with 2 Views - View 1 and View 2 - and, on each
view I placed a button to switch between the views. As I switched between
the views I displayed an alert to let me know the current dirty state. Each
time the alert stated that the form was NOT dirtied. Here is the code for
the buttons:

*****************************************

function btnSwitchView::OnClick(eventObj)
{
XDocument.View.SwitchView("View 2");

if (XDocument.IsDirty)
XDocument.UI.Alert("Data has been changed.");
else
XDocument.UI.Alert("Data has not been changed.");
}

function btnSwitchView2::OnClick(eventObj)
{
XDocument.View.SwitchView(""); // switch back to default

if (XDocument.IsDirty)
XDocument.UI.Alert("Data has been changed.");
else
XDocument.UI.Alert("Data has not been changed.");
}

*****************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top