Service Portal Widget won't refresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2018 11:43 AM
I am trying to get my widget to refresh when it hears an event.
I have confirmed that the widget hears the event and processes the input, however the HTML doesnt refresh.
Would anyone be able to help me understand why?
here is the html:
<div ng-if="data.showapprovals">
<div class="panel panel-{{::options.color}} b">
<div class="panel-body">
<div ng-if="data.approvals.length == 0">
${There are no approvals associated with this request yet}
!{{::data.jamestest}}!
</div>
</div>
</div>
here is the client script:
function ($scope, spUtil) {
if ($scope.options.portal == true || $scope.options.portal == 'true') {
$scope.contentColClass = "col-xs-12";
$scope.options.portal = true;
} else {
$scope.options.portal = false;
$scope.contentColClass = "col-sm-9";
}
$scope.data.op = "";
//spUtil.recordWatch($scope, "sysapproval_approver", "state=requested^approverIN" + $scope.data.myApprovals);
//2018-03-23 James Mcwhinney
//Refresh when the event is triggered
$scope.$on('eFormUpdated', function (event, sys_id) {
$scope.data.sys_id = sys_id;
$scope.data.jamestest = "hello world!";
$scope.server.update();
});
function get() {
spUtil.update($scope);
}
}
And here is the server script:
data.jamestest = 'defaultvalue';
if(input){
data.jamestest = input.jamestest;
gs.info('recieved test:' + input.jamestest + ':' + data.jamestest);
}
I can see in the log that it receives "hello world", but I dont see it show up in my widget.
Thanks!
- James
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2018 12:01 PM
Did you try using record watch?
spUtil.recordWatch($scope, "sysapproval_approver", "state=requested");
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2018 01:53 PM
It seems to be working now. Im not sure why it wasnt working before.. I dont think I changed anything significant.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2018 02:48 PM
Did record watch work or the the $scope.on event?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2018 02:47 PM
No, Im not sure what fixed it. maybe it was a caching issue.