There is indeed a getRoleList service
[lgpl/argeo-commons.git] / 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());