0 Replies Latest reply on Feb 10, 2011 9:58 AM by z.cristiano

    Multi checkbox on datagrid

    z.cristiano

      Hello flexy, thank you that you have m answer but may be that I have write badly!

       

      On file LIST.MXML have this code

       


      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
                  layout="absolute"
                  showCloseButton="true"
                  title="Gestione Menu"
                  width="556"
                  height="482"
                  close="PopUpManager.removePopUp(this);">
        
         <mx:Script>
        
         // ActionScript file

       

      import mx.events.FlexEvent;
      import mx.managers.PopUpManager;
      import mx.controls.CheckBox;
      import mx.controls.Alert;
      import flash.events.Event;
      import mx.events.FlexEvent;
      import mx.rpc.events.ResultEvent;
      import mx.rpc.events.FaultEvent;
      import mx.core.IFlexDisplayObject;

       

      private function modifica_gm():void
      {
         var win:IFlexDisplayObject = PopUpManager.createPopUp(this, gestione_menu_m, true);
        
         gestione_menu_m(win).id_modifica = lettura_gm.selectedItem.id_gm;
        
         PopUpManager.centerPopUp(win);
      }
        
         </mx:Script>
        
         <mx:Form x="0" y="0" width="536" height="442">
               <mx:FormItem label="Cerca Titolo">
                     <mx:TextInput width="402" id="cerca_titolo" change="read_gestione_menu.send()" creationComplete="read_gestione_menu.send()"/>
               </mx:FormItem>
               <mx:DataGrid id="lettura_gm" width="499" height="317" allowMultipleSelection="true" dataProvider="{read_gestione_menu.lastResult.users.user}" doubleClickEnabled="true" itemDoubleClick="modifica_gm()">
                  <mx:columns>
                     <mx:DataGridColumn headerText="Data" dataField="data"/>
                     <mx:DataGridColumn headerText="Titolo" dataField="titolo"/>
                     <mx:DataGridColumn headerText="Pos." dataField="posizione"/>
                     <mx:DataGridColumn headerText="" dataField="pubblicare"/>
                  </mx:columns>
               </mx:DataGrid>
         </mx:Form>
        
         <mx:HTTPService id="read_gestione_menu" method="POST" url="programs/gestione_menu.php" useProxy="false">
            <mx:request xmlns="">
               <cerca_titolo>
                  {cerca_titolo.text}
               </cerca_titolo>
            </mx:request>
         </mx:HTTPService>
        
      </mx:TitleWindow>

       

      On file UPDATE.MXML have this code

       


      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
                  layout="absolute"
                  showCloseButton="true"
                  title="Modifica Gestione Menu"
                  width="556"
                  height="308"
                  close="PopUpManager.removePopUp(this);">
        
         <mx:Script>
        
         // ActionScript file

       

      import flash.events.Event;

       

      import mx.controls.Alert;
      import mx.controls.CheckBox;
      import mx.events.FlexEvent;
      import mx.managers.PopUpManager;
      import mx.rpc.events.FaultEvent;
      import mx.rpc.events.ResultEvent;

       

      [Bindable]
      public var id_modifica:String;

       

      private function checkModifica(gestione_menu_modifica:ResultEvent):void
      {
        
         if(gestione_menu_modifica.result.modificasuccess == "si")
         {
           
            mx.controls.Alert.show("Modificato");
           
            read_gestione_menu.send();
           
            PopUpManager.removePopUp(this);
           
           
           
         }  
        
      }
        
         </mx:Script>
        
         <mx:Form x="0" y="0" width="536" height="268" creationComplete="gestione_menu_id.send()">
            <mx:FormItem label="Titolo" fontWeight="bold">
               <mx:TextInput width="380" fontWeight="normal" id="titolo" text="{gestione_menu_id.lastResult.titolo}"/>
            </mx:FormItem>
               <mx:Button label="Modifica" click="gestione_menu_modifica.send()"/>     
         </mx:Form>
        
         <mx:HTTPService id="gestione_menu_modifica" result="checkModifica(event)" method="POST" url="programs/gestione_menu_m.php" useProxy="false">
            <mx:request xmlns="">
               <id_modifica>
                  {id_modifica}
               </id_modifica>
               <titolo>
                  {titolo.text}
               </titolo>
            </mx:request>
         </mx:HTTPService>
        
         <mx:HTTPService id="gestione_menu_id" method="POST" url="programs/gestione_menu_id.php" useProxy="false">
            <mx:request xmlns="">
               <id_modifica>
                  {id_modifica}
               </id_modifica>
            </mx:request>
         </mx:HTTPService>
        
      </mx:TitleWindow>

       

      The code read_gestione_menu.send(); on this file UPDATE.MXML is error because it is Access of undefined property read_gestione_menu

       

      This code consists that when is is modify there is a window MODIFICATO, if I click OK, close the popupmanager of file UPDATE.MXML and refresh all date on datagrid of the popupmanager LIST.MXML..