2 Replies Latest reply on Oct 11, 2008 9:09 AM by MotionMaker

    cannot save new record, but edit record is no problem!

    jarmanje
      Hello, I have a bad error I cannot fix when trying to SAVE a new record. When editing a record, there is no problem:

      TypeError: Error #1010: A term is undefined and has no properties.
      at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()[E:\dev\3.1.0\framewor ks\projects\framework\src\mx\controls\listClasses\ListBase.as:1357]
      at mx.controls.listClasses::ListBase/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\fr amework\src\mx\controls\listClasses\ListBase.as:3657]
      at mx.controls.dataGridClasses::DataGridBase/updateDisplayList()[E:\dev\3.1.0\frameworks\pro jects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:581]
      at mx.controls::DataGrid/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\ mx\controls\DataGrid.as:1435]
      at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\ framework\src\mx\controls\listClasses\ListBase.as:3279]
      at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:605]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:678]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8565]
      at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8508]



      I use the php file generated by the create applicaiton from Database built into flex.

      Here is my code for both edit (which works) and save (which gives me the error)

      ////this is the functions for when you first go to edit / create new record

      private function editRecord():void
      {
      OrderForm.currentOrder = {orderid:0};
      currentState = "detail";
      }
      private function newRecord():void
      {
      OrderForm.currentOrder.orderid = 0
      currentState = "detail";
      applicationScreens.selectedChild = update;
      }


      ///this is the function for when you want to SAVE the edited record

      private function saveRecord():void
      {
      var neworder:Object = new Object();
      neworder.orderid = currentOrder.orderid;
      neworder.email = emailCol.text;
      neworder.salePoint = salePointCol.text;
      var e:OrderEvent = new OrderEvent("save", neworder);
      dispatchEvent(e);

      }



      This is my class called OrderEvent.as

      package events
      {
      import flash.events.Event;

      public class OrderEvent extends Event
      {
      public var order:Object;
      public function OrderEvent(type:String, order:Object)
      {
      super(type);
      this.order = order;
      }

      }
      }






      Please any help will be great!