2 Replies Latest reply on Oct 8, 2010 2:31 AM by SreejaVirtus

    Update datagrid

    SreejaVirtus

      Hi,

       

           In my project i had included number of components.In one component i need to update data from a table and have to display in the same page after clicking the update button.I cannot refresh refresh the datagrid. so i just called the datagrid creation complete handler but showing one error like

      "cannot access property or method of null object reference"

       

      whats the solution??

       

      Thanks in advance.

       

      sreejaVirtus

        • 1. Re: Update datagrid
          Anitha Selvaraj

          Can you post your code


          • 2. Re: Update datagrid
            SreejaVirtus Level 1

            i had used data services

             

            i cant send full code...so i m sending the needed part.

             

             

            protected

             

            function dataGrid_creationCompleteHandler():void

            {

            getAllFlex_classroomResult.token = flexclassroomService.getAllFlex_classroom();

            }

             

            protected

             

            function btn_update_clickHandler(event:MouseEvent):

            void

            {

             

            var item:Flex_classroom=new Flex_classroom();

            item.id=dataGrid.selectedItem.id;

            item.classroom=txt_classroom.text;

             

            if(rb_private.selected==true)

            {

            item.type=

            "Private";

            }

             

            if(rb_public.selected==true)

            {

            item.type=

            "Public";

            }

            updateFlex_classroomResult.token = flexclassroomService.updateFlex_classroom(item);

             

             

            if(updateFlex_classroomResult.token)

            {

            Alert.show(

            "Classroom has been updated successfully!");

            dataGrid.dataProvider=getAllFlex_classroomResult.lastResult;

            }

             

            }

             

             

            while clicking on the button it need to a message and list the updated data in the same page.

             

             

            thanks in advance.