AnsweredAssumed Answered

finesse User onLoad event

Question asked by chapelain36 on Feb 26, 2016
Latest reply on Feb 29, 2016 by dekwan

Hi, all.


I am learning to work with finesse gadgets using Learning gadget 10.5.1.
I declared an User object as in instruction.


finesse.modules.SampleGadget = (function($) {

    var user,

    handleUserLoad = function(userevent) {

        alert("user load");



    handleUserChange = function(userevent) {

        alert("user change");



    render = function() {

        var currentState = user.getState();

        // Examples of getting data from the User object (GET)




        if (user.hasSupervisorRole()) {


        } else {





        // Example of setting the user state (PUT)

        if (currentState === states.NOT_READY) {



        } else if (currentState === states.READY) {



        } else {






    /** @scope finesse.modules.SampleGadget */

    return {


        * Performs all initialization for this gadget


        init: function() {


            var prefs = new gadgets.Prefs(),

            id = prefs.getString("id");


            user = new finesse.restservices.User({

                id: id,

                onLoad: handleUserLoad,

                onChange: handleUserChange


            states = finesse.restservices.User.States;




} (jQuery));


But there is no onLoad event, when I am logging into finesse desktop as agent.
It alerts only when I am starting to change manually the agent state onLoad event, then onChange event - and this is behaviour of final gadget version too.
If I am trying to acess user object properties in browser debugger - there is an error


Can u please explain me, what am I doing wrong? Or maybe I have the wrong understanding of event model?


With regards, Yuriy.





















But I can access User data only when I changing the agent state manually.