0 Replies Latest reply on Apr 28, 2009 1:11 PM by snowscreen

    Update parameter issue

    snowscreen Level 1

      I have "createed an application from database" (php, mysql), and some neat autoscripts are given to me.

      I could all "understand" them, and they worked also fine when ported to other projects, but I have one SMALL PROBLEM:

       

      There is NO part where the implemented "update" function is used, so I don't know how to use it!

       

      given is e.g.:

       

       

       

      /////////////////////////////////// IF YOU DON'T WANT TO MESS WITH THIS CODE> JUST CUT THROUGH THIS RED TAPE////////////////////////////

       

       

      private function fill():void
      {
           /**
            * find the order parameters
            */
           var desc:Boolean = false;
           var orderField:String = '';
          
           if(!isNaN(orderColumn))
           {
               var col:DataGridColumn = dataGrid.columns[orderColumn];
               desc = col.sortDescending;
               //remove the 'Col' particle
               orderField = col.dataField.substr(0,col.dataField.length-3);
           }

       

          dataGrid.enabled = false;
           CursorManager.setBusyCursor();

       

          var parameters:* =
           {
               "orderField": orderField,
               "orderDirection": (desc) ? "DESC" : "ASC",
               "filter": filterTxt.text
           }
           /**
            * execute the server "select" command
            */
           doRequest("FindAll", parameters, fillHandler);
      }

       

      and the corresponding:

       

      public function doRequest(method_name:String, parameters:Object, callback:Function):void
      {
           // add the method to the parameters list
           parameters['method'] = method_name;

       

          gateway.request = parameters;

       

          var call:AsyncToken = gateway.send();
           call.request_params = gateway.request;

       

          call.handler = callback;

      }

       

       

      ////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////

       

      I guess I should change "findAll" to "update" as such functions are declared in the PHP script, but, as said I don't know how to use them / what to pass

       

      please provide help,

      snowscreen

       

      PS: Sample of the php update function is in the attachment.