Cannot find function getWidgetFromInstance

danmorella
Kilo Contributor

I'm trying to create a new header widget for use in a new service portal and I keep getting an error about the "getWidgetFromInstance" function when I try to fetch my menu.

js_includes_sp.jsx?v=05-16-2016_1044&lp=Tue_May_24_10_45_09_PDT_2016&c=2_42:71072 Server JavaScript error Cannot find function getWidgetFromInstance in object com.glide.service_portal.widget.fencing.ScopedSPScriptable@1044129.

Here is the server side code.

data.login_page = $sp.getValue('login_page');

var menu = $sp.getValue("sp_rectangle_menu");

data.menu = $sp.getWidgetFromInstance(menu);

It is the same first three lines that are in the stock header widget, so I have no idea why it can't find the function.

7 REPLIES 7

The instance references a widget... if you click on the menu from the portal, you just need to add the "widget" field to the form and from there you can specify which widget the menu uses. However I think you will find it's a little harder to clone that widget as it has ng-templates and one of those templates is referenced from a directive on the file system. This is a known defect, but only affects you if you absolutely cannot use the menu system that ships.


if you click on the menu from the portal, you just need to add the "widget" field to the form and from there you can specify which widget the menu uses

FYI: The 'widget' field is not displayed by default within the portal->menu form.   Now it makes finally makes sense!   Cheers.


Hi,



Any inputs on this issue. I am working in scoped portal and seeing the error message as stated above.



Regards,
Sujan