There is indeed a getRoleList service
authorCharles du Jeu <charles.dujeu@gmail.com>
Sat, 19 Sep 2009 19:39:01 +0000 (19:39 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Sat, 19 Sep 2009 19:39:01 +0000 (19:39 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@2983 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js

index 676aaa3d9bbf46b55020b2dfffe0c3cae0b0eb40..3533221af41a90ee4aed32c0b57b47721005acb8 100644 (file)
@@ -306,20 +306,15 @@ qx.Class.define("org.argeo.security.ria.RolesApplet",
         * @param data {Element} The text xml description. 
         */
        load : function(){
-               // WARNING, THE USERS APPLET MUST BE LOADED!
-               var vManager = org.argeo.ria.components.ViewsManager.getInstance();
-               this.usersAppletReference = vManager.getViewPaneById("users").getContent();
                
-               this.usersAppletReference.addListener("changeRolesList", function(event){
-                       var rolesList = event.getData();
+               var service = org.argeo.security.ria.SecurityAPI.getListRolesService();
+               service.addListener("completed", function(response){
                        var data = [];
-                       rolesList.forEach(function(el){data.push([el]);});
-                       this.tableModel.setData(data);
+                       response.getContent().forEach(function(el){data.push([el]);});
+                       this.tableModel.setData(data);                          
                }, this);
-               /*
-               var data = [["ROLE_ADMIN"],["ROLE_USER"]];
-               this.tableModel.setData(data);
-               */
+               service.send();
+               
                var commands = this.getCommands();
                this.toolBarPart.add(commands["new_role"].command.getToolbarButton());
                this.toolBarPart.add(commands["delete_role"].command.getToolbarButton());