3 Replies Latest reply on Jun 21, 2010 11:20 AM by USA Jon

    Flex Remote Object method reuse

    USA Jon

      Each remote object method has 1 return function. I need to call the method, and pass in a state, which returns the cities for that state. If I want to call this function for 2 different states and display them in different lists, how do I change where the return function calls so I can bind the second return data with a different variable than the first?

        • 1. Re: Flex Remote Object method reuse
          daslicht Level 2


          probably you could call the remoteFunction using different CallResponder.


          Never tried it with the RemoteObject since I now use the flex dataservices


          Something like:

          private var artistService:ArtistsService  = new ArtistsService();
          private var getAllArtistsResult      : CallResponder = new CallResponder();
                      getAllArtistsResult.token = artistService.getAllArtists();
          private var createArtistsResult                               : CallResponder = new CallResponder();
                      createArtistsResult.token = artistService.createArtists(item);





          Hope that helps in some way.


          1 person found this helpful
          • 2. Re: Flex Remote Object method reuse
            cheftimo Level 2

            Here is an example:


            <mx:RemoteObject id="srvc"
                  showBusyCursor="true" >
                  <mx:method name="getCatalog" result="productServiceResultHandler(event)">
                  <mx:method name="getFavesList" result="idListResultHandler(event)">
                  <mx:method name="getSubCatalog" result="subCatalogResultHandler(event)"/>
                  <mx:method name="getCategoryList" result="categoryListHandler(event)"/>


            In this case, in method ‘getCatalog’, if you wanted to get the catalog for a different ‘currentCatID’, you would change the value stored in ‘currentCatID’.