Hi All,

     In my application am using the [b]List Control[/b] and the [b]
itemRenderer[/b] to display the data which comes from the [b]DataBase[/
b].On [b]creationComplete[/b] of my parent component(List component
exists here),am calling a method which gets the data from the database
and i have a creationComplete event for my itemRenderer also.

           If i do add to list and even for a small change in the
items every time creationComplete event gets fired of itemrenderer
component except for the updating an item and for removing an
item ,since, for an item renderer or item editor, Flex might reuse an
instance of the item renderer or item editor and a reused instance of
an item renderer or item editor does not redispatch the
creationComplete event.


   Am displaying all my items along with the checkbox and now when i
click on the checkbox,am setting item to [b]enabled=false[/b] and
calling update method to set the status flag(by default 0) value to 1
to update in the database.When i unselect the checkbox am doing the
reverse (setting enabled = true) and this time also creationComplete
of itemRenderer getting fired.

   Now the problem is that,when i select the checkbox ,item getting
enabled(false) and it's suddenly setting to enabled=true without
unchecking the
checkbox and for the second time it work's properly and for third time
it won't and like that it is behaving alternatively.All this happening
on [b]click event of CheckBox[/b] and i tried with change event also
but it doesn't help me.

  And also I can add multiple new items to List and i can't add after
updating or removing an existing item.If i reload the application then
i can add the new items.s

   can any one help me how to solve this problem ? Any help can be
Appriciated.

   Thanks in advance.

   <mx:CheckBox id="cbStatus"  click="clickChkBox(event)"/>

   private function clickChkBox(event:Event):void {
                if (cbStatus.selected) {
                                 todoItem.status = 1;
                        }
                        else {
                                todoItem.status = 0;

                updateItem(event); // here am dispatching the event and in my 
parent
component am calling actual backend method to update in DB and
getting
                                     the result back in my ResultEventHandler.
                                   //and am calling afterUpdateMethod to set 
item to
enabled = false/true based on checkbox selected value
                afterUpdate();
        }

        private function afterUpdate():void {
            if (cbStatus.selected) {
                name.enabled = false;
                dob.enabled = false;
            }
            else {
                name.enabled = true;
                dob.enabled = true;
            }
    }

     But it doesn't help me !

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to