Widget that reacts to onChange event of Variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2018 10:59 PM
Hi. I am building a Catalog Item for use in the Service Portal. I have a Widget that is embedded in the Catalog Item using a Macro type Variable. And I have another Reference type Variable on the Item. I want the Widget to respond when the Reference field is changed. It needs to look up and display information related to the Referenced record.
I have found about a million Community Articles, Blogs, and YouTube videos that explain how you can use $rootScope.$broadcast to communicate between Widgets. But I'm not trying to communicate between 2 Widgets. I need to communicate from an onChange Catalog Client Script to a Widget. Or I need to add a listener to the Reference type Variable from my Widget. Or I need a different solution entirely. Does anybody know how to do this?
My workaround at the moment is to use a setInterval in the Widget that manually looks for a change in the Reference Variable using $scope.page.g_form.getValue('my_ref_field'). This solution works, but it sucks and I hate it.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 05:50 AM
It worked perfectly for me. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2022 12:01 PM
My pleasure, glad it helped 😉