I want to call a widget from another widget in Service Portal.

saurabhchande
Tera Expert

I want to call a widget from another widget in Service Portal. A parent widget is in the macro variable of a catalog item.. and there is a child widget containing few data.. I want to call the child widget in Parent widget and use the data in parent.

Childwidget will contain some server side script like :

var htmlname = "<some_text_here">;

data.htmlsysid = "<some_sysid>";

I want to send the data of child widget to parent widget and use it in parent widget.

Can anyone help here?

8 REPLIES 8

Surendra Raika1
Kilo Guru

Okay .. inter-widget communication you can use a shared array ..



https://www.cernasolutions.com/portal-pet-adoption-thoughts-modals/



This may help you a great extent.


Martin Nguyen
Tera Contributor

I believe you would want to use $emit and $broadcast. This thread should help you



How to communicate between widgets in Service Portal


Thanks Martin. I followed the steps from the link..



Let me know if I am doing correct or not.. Below is the Parent widget from which I need to pass the data.



find_real_file.png



Here is the child widget in which I need to use the data which is coming.



find_real_file.png


sachin_namjoshi
Kilo Patron
Kilo Patron

This link might help you in communication between widgets



Using Events to Communicate Between Widgets - ServicePortal.io - Service Portal, CMS, and Custom App...



Regards,


Sachin