Broadcasting on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 11:23 PM
Hi,
I have a multiple reference field widget on my service portal on which multiple values can be selected.
On the other hand i have one more widget below it with two tiles like structure each having a view button on it which when clicked takes the user to page where he/she can view the specific report.
The multiple reference field now has multiple values selected to it and when the user click on the view button of one of the tile on the other widget the values(can be more than one) from the multiple reference field should be applied as a filter and the report should be displayed on the other page's widget.
How this can be achieved?
Any help?
Thanks,
Shahid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2017 03:53 AM
Hi
Everything you need to know should be covered here: Using Events to Communicate Between Widgets - ServicePortal.io - Service Portal, CMS, and Custom App...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2017 04:25 PM
Hi Shadid,
Which part do you have trouble with?
Just to quickly recap what you have so far:
- Multi input box which generate an event (field.change when updated)
- Inside the $scope.$on function which listen to that event you would trigger a $rootScope.$broadcast just like presented in the serviceportal.io article. Your brodcast would include an event name and the newValue of the input field.
- In your widget(s) with your tiles you would have a client script $rootScope.$on function that listen for the peviously broadcast event. When it receives the event it would set a $scope variable to that newValue that was received.
- When the user click on the view button you should use the value that you placed in a $scope variable to build the filter to be used by the report.
Which part are you having trouble with or missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2017 12:48 AM
HI Laurent,
Hope you are doing good.
I was busy for a while these days hence could not respond to this email.
I have broadcast the values successfully , after your help, to the other widget.
Next step for me will be to fetch the broadcasted value to the server side scripting from the client controller.
My script looks like :-
$rootScope.$on('setFilterBroadcast', function (event, data) {
$scope.setNewFilter = data;
});
Where setFilterBroadcast is the variable which is used to broadcast the value from the original widget. And i am setting that value fetched to $scope.setNewFilter. Now can you please help me in passing this value from client controller to the server script?
Thanks,
Shahid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2017 01:06 AM
Hi
Everything you need to know is here: Communicating between the Client Script and the Server Script of a widget - ServicePortal.io - Servi...