11-08-2024 02:08 AM
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
11-10-2024 06:00 AM
I Think the best Way is using the developer tool in your browser (f12).
what is the error?
is the gadget loading at all ?
11-11-2024 12:47 AM
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
11-13-2024 12:25 AM - edited 11-13-2024 12:26 AM
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 ($) {
11-13-2024 12:30 AM
what are you trying to write to the log with the
console.log('containerServices', containerServices); ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide