0 Replies Latest reply: Jan 19, 2016 11:24 AM by dion verbeke RSS

    Tieing a promise to a UI object

    dion verbeke

      Hi all,

       

      I'm still struggling with the promises paradigm to include in the paradigm:

       

      var p = global.getAuthenticatedUser(function(reply){

                   alert('User:'+reply.qReturn);

      var  v =  reply.qReturn;

        console.log(reply.qReturn);

       

        console.log(afe_encryptUser(v));

        

        });

       

       

      Later in the code I have to display the authenticated user.

       

      How do I get to use the reply.qReturn if the call is asynchronous?

      If I include the layout code inside the promise I don't have access to the layout and $element of the paint function.

       

      Does some have example code how to achieve this?

       

      Kind Regards,

       

      Dion