diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/CommandRefreshNavigationBookmarks.as b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/CommandRefreshNavigationBookmarks.as index 356eb0f..784d942 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/CommandRefreshNavigationBookmarks.as +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/CommandRefreshNavigationBookmarks.as @@ -27,7 +27,6 @@ package controller var leftMenuNavModel:LeftMenuNavigationModel = mainMediator.view["model"] as LeftMenuNavigationModel; var bookmarksNav:Object = mainMediator.view.viewBookmarksNavigation; var bookmarksList:ArrayList = new ArrayList(); - var appWhiteSpaceRegExp:RegExp = new RegExp(/\s+/gi); var groups:Array = []; for each (var bookmark:BookmarkVO in bookmarks) @@ -72,7 +71,7 @@ package controller groups.forEach(function(group:Object, index:int, arr:Array):void{ var menuItem:NavigationLinkVO = new NavigationLinkVO(group.name, "", "mdi mdi-apps mdi-24px", - MediatorBookmarks.NAME + group.name.replace(appWhiteSpaceRegExp, ""), group); + MediatorBookmarks.getMediatorName(group.name), group); bookmarksList.addItem(menuItem); }); diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/roles/executeRoles/CommandExecuteRolesBookmarksView.as b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/roles/executeRoles/CommandExecuteRolesBookmarksView.as index f296a17..1a501bf 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/roles/executeRoles/CommandExecuteRolesBookmarksView.as +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/controller/roles/executeRoles/CommandExecuteRolesBookmarksView.as @@ -18,7 +18,7 @@ package controller.roles.executeRoles { var bookmarksProxy:ProxyBookmarks = facade.retrieveProxy(ProxyBookmarks.NAME) as ProxyBookmarks; - var bookmarksMediatorName:String = MediatorBookmarks.NAME + bookmarksProxy.selectedGroup; + var bookmarksMediatorName:String = MediatorBookmarks.getMediatorName(bookmarksProxy.selectedGroup); if (facade.hasMediator(bookmarksMediatorName)) { var bookmarksMediator:MediatorBookmarks = facade.retrieveMediator(bookmarksMediatorName) as MediatorBookmarks; diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/bookmarks/MediatorBookmarks.as b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/bookmarks/MediatorBookmarks.as index 2afd7da..b26da97 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/bookmarks/MediatorBookmarks.as +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/bookmarks/MediatorBookmarks.as @@ -40,6 +40,13 @@ package mediator.bookmarks super(mediatorName, component); } + public static function getMediatorName(bookmarkGroup:String):String + { + var appWhiteSpaceRegExp:RegExp = new RegExp(/\s+/gi); + + return MediatorBookmarks.NAME + bookmarkGroup.replace(appWhiteSpaceRegExp, ""); + } + override public function onRegister():void { super.onRegister(); @@ -57,8 +64,6 @@ package mediator.bookmarks this.view.currentState = this.bookmarksProxy.selectedGroup == "Browse My Server" ? BROWSE_MY_SERVER_VIEW_STATE : BOOKMARKS_VIEW_STATE; } - - sendNotification(ApplicationConstants.COMMAND_EXECUTE_BOOKMARKS_ROLES); } override public function onRemove():void @@ -137,8 +142,6 @@ package mediator.bookmarks this.cleanUpBookmarksList(); this.updateListOfBookmarks(); - - sendNotification(ApplicationConstants.COMMAND_EXECUTE_ROLES); } else if (view["currentState"] == BROWSE_MY_SERVER_VIEW_STATE) { @@ -148,6 +151,8 @@ package mediator.bookmarks facade.registerMediator(new MediatorBrowseMyServer(view.browseMyServerView)); view.title = "Browse My Server"; } + + sendNotification(ApplicationConstants.COMMAND_EXECUTE_ROLES); } private function updateListOfBookmarks():void