3 Replies Latest reply on Jun 26, 2008 6:45 PM by ntsiii

    How to call a function/event after a Remote Object's data is loaded?

    EvolvedDSM Level 2
      I'm making a call to a remote object that is loading a good amount of data. I've set up a "please wait" label that is supposed to display while the data is being loaded and then clear the label when the data finishes loading.

      At the moment I've got it set up like so...
      label = 'Loading data, please wait..."
      remoteObj.read.send();
      label = ''

      The problem with this is that the 'please wait' label doesn't even display because the actual call to the remote object I'm making finishes so quickly even though the data load does not. So what I need is possibly an IF statement to check if the data has finished loading. If it hasn't finished loading, the label stays in the "please wait" status, or if the data does finish loading, then the label clears out.

      What would be ideal is...
      remoteObj.read.send(); // gets the data
      if(data is loaded){
      label = '';
      }else{
      label = 'Please wait'
      }

      I just don't know how to form the statement for the data loading in the IF statement.