ItEr39S10CUAltaUsuario: implemented removal of Profiles in the User edition interface
This commit is contained in:
parent
2900f0afab
commit
0131f43b50
4 changed files with 26 additions and 0 deletions
|
|
@ -96,4 +96,12 @@ public interface IUserModel {
|
|||
*/
|
||||
List<Profile> getProfiles();
|
||||
|
||||
/**
|
||||
* Removes a profile from the list of {@link Profile} objects associated
|
||||
* with the current User.
|
||||
*
|
||||
* @param role The {@link Profile} object to be removed.
|
||||
*/
|
||||
void removeProfile(Profile profile);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,6 +168,11 @@ public class UserCRUDController extends GenericForwardComposer implements
|
|||
return userModel.getProfiles();
|
||||
}
|
||||
|
||||
public void removeProfile(Profile profile) {
|
||||
userModel.removeProfile(profile);
|
||||
Util.reloadBindings(createWindow);
|
||||
}
|
||||
|
||||
private OnlyOneVisible getVisibility() {
|
||||
return (visibility == null) ? new OnlyOneVisible(createWindow,
|
||||
listWindow)
|
||||
|
|
|
|||
|
|
@ -137,4 +137,9 @@ public class UserModel implements IUserModel {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeProfile(Profile profile) {
|
||||
user.removeProfile(profile);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,10 +81,18 @@
|
|||
<grid id="profilesListing" model="@{controller.profiles}">
|
||||
<columns sizable="true">
|
||||
<column label="${i18n:_('Profile name')}" />
|
||||
<column label="${i18n:_('Actions')}" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row self="@{each='profile'}" value="@{profile}">
|
||||
<label value="@{profile.profileName}" />
|
||||
<hbox>
|
||||
<button sclass="icono" image="/common/img/ico_borrar1.png"
|
||||
hoverImage="/common/img/ico_borrar.png"
|
||||
tooltiptext="${i18n:_('Delete')}"
|
||||
onClick="controller.removeProfile(self.parent.parent.value);">
|
||||
</button>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue