X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ria%2Fsrc%2Fargeo-ria-lib%2Fsecurity%2Fclass%2Forg%2Fargeo%2Fsecurity%2Fria%2FRolesApplet.js;h=676aaa3d9bbf46b55020b2dfffe0c3cae0b0eb40;hb=f7c73e12f9534b0b796686e207dd4b43193977fa;hp=da45d965bb08421cee79f69f2e5fad8c96b42fb4;hpb=e80be147bdb65aa2a0c34e848ca78851b781508d;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js index da45d965b..676aaa3d9 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js @@ -263,10 +263,11 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", return; } var uniqueValue = this._selectionToValues(selectionModel)[0]; - var initSelection = this.rolesUsersStub[uniqueValue]; + //var initSelection = this.rolesUsersStub[uniqueValue]; + this.usersAppletReference.applySelection(uniqueValue, "roles"); + var initSelection = this.usersAppletReference.getViewSelection().getNodes(); this.setChooserOriginalSelection(initSelection); this.setChooserSelectionModified(false); - this.usersAppletReference.applySelection(initSelection, "username"); this.saveButton.setEnabled(false); }, @@ -304,10 +305,21 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", * Load a given row : the data passed must be a simple data array. * @param data {Element} The text xml description. */ - load : function(){ + 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 data = []; + rolesList.forEach(function(el){data.push([el]);}); + this.tableModel.setData(data); + }, this); + /* var data = [["ROLE_ADMIN"],["ROLE_USER"]]; this.tableModel.setData(data); - + */ var commands = this.getCommands(); this.toolBarPart.add(commands["new_role"].command.getToolbarButton()); this.toolBarPart.add(commands["delete_role"].command.getToolbarButton());