- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 11:13 AM
Is there a way to refresh service portal page (form) when user clicks on any UI action (we have 4 custom UI actions on the form). Thanks for your help
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:08 PM
If you are using the 'form' widget the form itself should update by itself when the ui action is complete. You can however preform aditional actions by cloning this widget.
If you clone the form widget, there is an event listener for when the ui action is complete in the client script.\
$scope.$on("spModel.uiActionComplete", function(evt, response) {
var sysID = (response.isInsert) ? response.sys_id : $scope.data.sys_id;
loadForm($scope.data.table, sysID).then(constructResponseHandler(response));
});
You can add code here to do whatever you need to do.
For example
- You could broadcast a rootscope event that other widgets on the page can listen to to update themselves
- You could navigate to other pages or itself
- You attempt to refresh scope
just a couple suggestions to help you get started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:08 PM
If you are using the 'form' widget the form itself should update by itself when the ui action is complete. You can however preform aditional actions by cloning this widget.
If you clone the form widget, there is an event listener for when the ui action is complete in the client script.\
$scope.$on("spModel.uiActionComplete", function(evt, response) {
var sysID = (response.isInsert) ? response.sys_id : $scope.data.sys_id;
loadForm($scope.data.table, sysID).then(constructResponseHandler(response));
});
You can add code here to do whatever you need to do.
For example
- You could broadcast a rootscope event that other widgets on the page can listen to to update themselves
- You could navigate to other pages or itself
- You attempt to refresh scope
just a couple suggestions to help you get started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 04:53 PM
i tried this and it works except when you click on "Save" button, it displays a pop up to stay on the page or leave.
<button ng-click="triggerUIAction(action)" ng-repeat="action in getUIActions('button')" class="btn btn-primary action-btn pull-right btn-green" onclick="location.reload()">{{action.name}}</button>