2011-12-22 75 views

回答

0

我用這一點,下面是該語法。

<mx:RemoteObject id="roTestQuestion" destination="GenericDestination" 
    source="FlexDataLayer.BusinessLogic.TestQuestionBLL" showBusyCursor="true" fault=" {onFault(event);}"> 
    <mx:method name="GetList" result="{roTestQuestion_GetList(event);}" /> 
    <mx:method name="GetAnswerList" result="{roTestQuestion_GetAnswerList(event);}" /> 
    <mx:method name="Insert" result="{roTestQuestion_Insert(event);}" /> 
    <mx:method name="Update" result="{roTestQuestion_Update(event);}" /> 
    <mx:method name="Delete" result="{roTestQuestion_Delete(event);}" /> 
    <mx:method name="GetListByCategoryID" result="{roTestQuestion_GetListByCategoryID(event);}" /> 
</mx:RemoteObject> 

源是你的.NET類,你需要創建一個方法,我寫錯誤和結果。

的故障

private function onFault(e:FaultEvent):void 
{ 
Alert.show(e.fault.message.toString(),parentApplication.alertTitle);  
} 

的結果

private function roTestQuestion_Delete(e:ResultEvent):void 
     { 
      if (e.result!= null) 
      { 
       if(cbCat.selectedIndex == 0) 
       { 
        roTestQuestion.GetList(); 
       } 
       else 
       { 
        roTestQuestion.GetListByCategoryID(selIndex); 
       } 
       //roTestQuestion.GetList(); 
       //Application.application._mdlExamSelection.Init(); 
      } 
     } 

這裏我給打電話從RemoteObject該方法的方法。

roTestQuestion.GetList(); 

您是初學者,所以我建議你去通過下面的鏈接,因爲在未來ü需要使用ActionScript而這個鏈接將要對你非常有用......

請訪問這Link

+1

感謝薩格爾拉瓦爾, 我會嘗試這一點,並告訴你,如果我得到任何問題。 – 2011-12-22 08:44:55

+1

沒問題。我相信你不會去解決任何問題。 – 2011-12-22 08:47:28

+1

感謝卓越的工作sagar ....它幫助我很多 – 2012-01-07 06:30:58