1 Reply Latest reply on Jun 29, 2007 1:32 AM by Clark_Kent101

    What if RemoteObject call returns an empty recordset?

    gammajack
      I am trying to devise a scheme to send a request to a cfc and return a query. The following model gives me what I want when I return at least 1 record.

      RemoteObject <=(Get some recordset)=> CFC calls query of db tbl <=(recordcount > 1 )=> event handler event casts the query as an arrayCollection.

      But, when the cfc returns a recordcount = 0 the arraycollection has nothing in it to evaluate.

      In cf I use <cfif not recordset.recordcount is 0> Do This

      How should I set this up in a flex project?

      Thank you.
        • 1. Re: What if RemoteObject call returns an empty recordset?
          Clark_Kent101
          If you're returning a query with a recordCount of 0, chances are flex will receive a null value or an empty value, so in your handler in Flex you could implement an if statement in your handler which determines what action to take depending on what the cfc returns.... for example:

          ----------------------------------------------------

          private function cfcReceiver(event:ResultEvent):void
          {
          if (event.result != null && event.result != '')
          {
          _arrayCollectionName = event.result as ArrayCollection;
          }
          else
          {
          // do something else
          }
          }

          ----------------------------------------------------

          Hope this helps.

          - Tony