cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
277
Views
0
Helpful
4
Replies

3rd party Finesse Gadget problem with ContainerServices.init();

vvazquez
Cisco Employee
Cisco Employee

Hi, I am building a 3rd party Finesse Gadget for PCCE, and adding logs to my js code I think that it is failing in this line:

containerServices = finesse.containerservices.ContainerServices.init();

 

What is the best way to troubleshoot?

Thanks

4 Replies 4

I Think the best Way is using the developer tool in your browser (f12).

what is the error?

is the gadget loading at all ?

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Thank you Thomas,

 

the gadget loads, I can see one line of text inside the body of the xml file. Then I do:
<script type="text/javascript">
gadgets.HubSettings.onConnect = function () {
finesse.modules.WebexMeetingsGadget.init();
};
</script>

And my init function:

init: function () {
console.log('init function');
containerServices = finesse.containerservices.ContainerServices.init();
console.log('containerServices', containerServices);

 

On the console I can see like the init funtcion starts (console.log('init function')) but the line

console.log('containerServices', containerServices);

is not executed. Something must be wrong in containerServices = finesse.containerservices.ContainerServices.init();

Regards,

Victor

Im normaly do the init like this 

 

 init: function () {
     var cfg = finesse.gadget.Config;
     clientLogs = finesse.cslogger.ClientLogger;  // declare clientLogs
     gadgets.window.adjustHeight();
     finesse.clientservices.ClientServices.init(cfg, false);
     clientLogs.init(gadgets.Hub, "WebexMeetingsGadget", finesse.gadget.Config); //this gadget id will be logged as a part of the message

     user = new finesse.restservices.User({
         id: cfg.id,
         onLoad: handleUserLoad,
         onChange: handleUserChange
     });

     states = finesse.restservices.User.States;
     containerServices = finesse.containerservices.ContainerServices.init();
     containerServices.addHandler(finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB, function () {
         clientLogs.log("init(): Gadget is now visible and ready to use.");  // log to Finesse logger
     });
     containerServices.makeActiveTabReq();
 }

 

 

and then use clientLogs.log("your logging") as the log tool.

 

Remember to use the right namespace:

 

var finesse = finesse || {};
finesse.gadget = finesse.gadget || {};
finesse.container = finesse.container || {};
clientLogs = finesse.cslogger.ClientLogger || {};  // for logging

/** @namespace */
finesse.modules = finesse.modules || {};
finesse.modules.WebexMeetingsGadget = (function ($) {

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

what are you trying to write to the log with the 

console.log('containerServices', containerServices); ?

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.