I've done this like below.
1. In each Input field, check box, combo etc. I listen to the change
event like this
change="editData(event.target)"
2. I've got a global variable to hold info of all changed items
public var editedObjects:Array = new Array();
3. editData function
public function editData(obj:Object):void{
//check if event.target was already changed
var addData:Boolean = true;
//verify if editedObjects contains items
if (editedObjects.length>0)
{
for(var i:int = 0; i< editedObjects.length;
i++) {
//If object is found do not
add it again
if(editedObjects[i]==obj){
addData = false;
}
}
}
//If object is not found add it to array
if (addData){
editedObjects[editedObjects.length]=obj;
}
//change parameters of selected object to show to
user which fields has been changed
obj.setStyle('backgroundColor', 0xFFCCCC);
obj.setStyle('borderColor', 0xFF99CC);
obj.setStyle('borderThickness',2);
obj.setStyle('color',0x993300);
obj.setStyle('fontWeight','bold');
}
4. If editedObjects.length>0 then there are changes.
editedObjects contains an array with references to all changed items.
You may loop the array and do what ever you wish with the changed
items.
Hope this helps.
-jari
--- In [email protected], "dean_w_schulze"
<[EMAIL PROTECTED]> wrote:
>
> In Flex is there a way to determine if a user has made any input to
any
> control on a page without having to check each individual control?
My
> app. makes use of several TabNavigators with several tabs in each
and I
> would like a way to tell which tabs have changes, if any, when the
user
> clicks Submit instead of reading the state of every control on
every
> page.
>
> What I'm hoping for is something like an uber-event handler that I
> could register every control on a page with, in addition to the
> control's individual event handler. In the uber-event handler I
could
> simply record that something had changed on that page and maybe
keep
> track of which controls need to be read on Submit.
>
> Thanks.
>