0 Replies Latest reply on Jun 8, 2011 1:41 AM by pjlumby

    DataService Problem

    pjlumby

      I have set up some basic CRUD services, the reading part works fine but create, update and delete don't seem to do a bean. I have been using the network monitor to see what is happening and can see my read services woking fine but the others dont do a thing when called.

       

       

       

       

       

       

      The services work fine when I use the sevices test operation in flash builder, just nothing when testing on the build. When I'm debugging I can see the click handler is called but then the service call doesn't seem to fire.

       

      Pete

       

       

       

      <fx:Declarations>

      <customcategoryservice:CustomcategoryService id="customcategoryService"
      fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
      showBusyCursor="true"/>
      <s:CallResponder id="createCustom_categoryResult"/>
      <s:CallResponder id="getCustom_categoryByAuthorIDResult2" result="getCustom_categoryByAuthorIDResult2_resultHandler(event)"/>
      <s:CallResponder id="updateCustom_categoryResult" result="updateCustom_categoryResult_resultHandler(event)"/>
      <s:CallResponder id="deleteCustom_categoryResult" result="deleteCustom_categoryResult_resultHandler(event)"/>

      </fx:Declarations>

       

       

      <fx:Script>

       

      protected function cat_dg_creationCompleteHandler(event:FlexEvent):void
      {
      getCustom_categoryByAuthorIDResult2.token = customcategoryService.getCustom_categoryByAuthorID(current_user, image_target);
      }

      protected function getCustom_categoryByAuthorIDResult2_resultHandler(event:ResultEvent): void
      {
      // TODO Auto-generated method stub
      arr_custom_categories = event.result as ArrayCollection;
      }

      protected function update_button_clickHandler(item:Custom_category):void
      {
      updateCustom_categoryResult.token = customcategoryService.updateCustom_category(item);
      }

      protected function delete_button_clickHandler(itemID:int):void
      {
      deleteCustom_categoryResult.token = customcategoryService.deleteCustom_category(itemID);
      }

      protected function createCustom_categoryResult_resultHandler(event:ResultEvent):void
      {
      arr_custom_categories.addItem(event.result);
      custom_category = event.result as Custom_category;
      cat_dg.scrollToIndex(arr_custom_categories.length);
      }
      protected function updateCustom_categoryResult_resultHandler(event:ResultEvent):void
      {
      trace('Updated successfully');
      }

      protected function deleteCustom_categoryResult_resultHandler(event:ResultEvent):void
      {
      arr_custom_categories.removeItemAt(cat_dg.selectedIndex);
      }

       

      </fx:Script>