On my form page, I have 3 buttons labeled: Commit, Undo, Done respectively. When the form first opens, popuplated with data, the Commit and Undo buttons are disabled (designed that way in Desing mode). When the user changes any data in any field, I would like the "Done" button to become disabled, and the Commit and Undo buttons to become enabled. How do I "tell" the Commit and Undo buttons to become enabled on data change?
After the data is committed to the database, how do I tell the Commit and Undo buttons to become disabled and the "Done" button to become enabled again?
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
Create a bindable boolean variable in the form page say [Bindable]private var formChanged:Boolean = false;
set this to true in the change events of any of the form input fields.
Buttons enabled state can be bound to this boolean property like this
<mx:Button id="btnCommit" enabled="{formChanged}"/>
<mx:Button id="btnUndo" enabled="{formChanged}"/>
<mx:Button id="btnDone" enabled="{!formChanged}"/>
After the data is committed to the database, set the formChanged to false
Views
Replies
Total Likes
Create a bindable boolean variable in the form page say [Bindable]private var formChanged:Boolean = false;
set this to true in the change events of any of the form input fields.
Buttons enabled state can be bound to this boolean property like this
<mx:Button id="btnCommit" enabled="{formChanged}"/>
<mx:Button id="btnUndo" enabled="{formChanged}"/>
<mx:Button id="btnDone" enabled="{!formChanged}"/>
After the data is committed to the database, set the formChanged to false
Views
Replies
Total Likes