- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-20-2018 09:11 AM
I am posting this article for anyone who might experience problems with the user of spAriaFocusManager or spAriaFocusManagerProvider when developing a Service Portal widget. The spAriaFocusManager is a client controller attribute you can use for links in the Jakarta version but it appears that it does not work with Istanbul and the widget it is used in fails to load. So if you would like to use spAriaFocusManager in earlier versions you can add the following function on top of your main client controller function like this:
//Widget Client controller
function spAriaFocusManager() {
var danglingNavigation;
var onPageLoadHandlerCallback;
function linkHandler(newLinkRoute) {
danglingNavigation = newLinkRoute;
}
function pageLoadComplete(newPageRoute) {
if (newPageRoute == danglingNavigation && onPageLoadHandlerCallback) {
onPageLoadHandlerCallback();
}
danglingNavigation = null;
}
function registerPageTitleCallback(pageLoadHandlerFn) {
onPageLoadHandlerCallback = pageLoadHandlerFn;
}
function focusOnPageTitle() {
if (onPageLoadHandlerCallback) {
onPageLoadHandlerCallback();
}
}
return {
navigateToLink: linkHandler,
pageLoadComplete: pageLoadComplete,
registerPageTitleFocus: registerPageTitleCallback,
focusOnPageTitle: focusOnPageTitle
}
}
//From here on you can continue with the your main function:
function($scope, $rootScope, $location, spUtil, $timeout, spAriaFocusManager) {
//Your code here
}