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
‎04-03-2018 02:50 PM
Take out the :: in the HTML. That will fix the issue. Use like this {{variableName}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2022 02:29 PM
Solved the issue for me