2 Replies Latest reply on Sep 8, 2010 8:24 AM by szehau

    Flex 1.5 RemoteObject: Fault event never being triggered

    szehau

      Hi,

       

      I'm new to flex. I'm using a remote object in my code by I found that the fault event never being triggered. For example, I click a button on the flex and it calls the remote method and it returns data successfully; I disconnect the network, then I click the button on the flex and it calls the remote method and hang for forever with the busy icon (the fault handler never get called although it was defined).

       

      <mx:RemoteObject id="service01"

        fault="faultHandler(event.fault.faultstring)"

        type="stateless-class"

        named="Service01"

        endpoint="/amfgateway?a=0"

        showBusyCursor="true"

      >

        <mx:method name="getValue" result="handleGetValue(event)" />

      </mx:RemoteObject>

       

      or

       

      <mx:RemoteObject id="service01"

        type="stateless-class"

        named="Service01"

        endpoint="/amfgateway?a=0"

        showBusyCursor="true"

      >

        <mx:method name="getValue" result="handleGetValue(event)" fault="faultHandler(event.fault.faultstring)" />

      </mx:RemoteObject>

       

      I really have no idea what's wrong. Could it be a bug in Flex 1.5?

       

      Please help. Thanks!

        • 1. Re: Flex 1.5 RemoteObject: Fault event never being triggered
          jfb00 Level 3

          Hi,

          What do you use old flex if you have the new SDK for free :)?

          try to use an alert in the fault like

          fault="Alert.show(event.fault.faultstring), 'Error'"
          Rgds

          Johnny
          • 2. Re: Flex 1.5 RemoteObject: Fault event never being triggered
            szehau Level 1

            Hi Jonny,

             

            I have tried that before but just no luck. The correct one should be

             

            fault="Alert.show(event.fault.faultstring, 'Error'")

             

            If I call the remote object with invalid name, the fault handler will be called.

             

            If I call the remote object with valid name and when remote server is down (or with an invalid endpoint), the fault handler never been called and the busy icon will forever there.

             

            Anyone encounter this? Or anyone know if this is a known bug in Flex 1.5?

             

            I try not migrate the code to use the new SDK if it is not a bug in Flex 1.5.

             

            Thanks!