Can we auto-refresh a widget in Service Portal ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 01:14 PM
Can we turn ON Auto-Refresh for a particular widget in Service Portal to auto-refresh every second?
As an example I was looking through below code but when I tried placing it in server script portion of my widget, I get an error that "angular" is not defined.
Can anyone please assist?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:16 PM
You got a OOB "cool clock" widget. I think that will give you exactly what you are after
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:22 PM
I am using this now....However whole page is refreshing after 15 secs...Cant just the widget refresh?
function($scope,$interval,$window) {
$interval(function(){
$window.location.reload();
},15000);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:38 PM
call $scope.server.update() from $interval function..so that it will call server script periodically.
(please mark helpful/like/correct if it helps)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 11:42 AM
rossipatel So basically it be like below?
- Do I have to do anything in server script part?
- So basically only my widget will refersh and not the page itself?
function($scope,$interval,$window) {
$interval(function(){
$scope.server.update();
},15000);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 11:47 AM
yupp..only widget will re-render...i would suggest you to go trough below documentation before jumpting into building things..
(please mark helpful/like/correct if it helps)