Bug #1486: Sort UserRole list before adding it to the combo box.
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
f85e93f2e1
commit
13ee4ff118
1 changed files with 9 additions and 0 deletions
|
|
@ -25,6 +25,8 @@ import static org.libreplan.web.I18nHelper._;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -151,6 +153,13 @@ public class UserCRUDController extends BaseCRUDController<User> implements
|
|||
.values()));
|
||||
roles.remove(UserRole.ROLE_BOUND_USER);
|
||||
|
||||
Collections.sort(roles, new Comparator<UserRole> () {
|
||||
@Override
|
||||
public int compare(UserRole arg0, UserRole arg1) {
|
||||
return arg0.getDisplayName().compareTo(arg1.getDisplayName());
|
||||
}
|
||||
});
|
||||
|
||||
for (UserRole role : roles) {
|
||||
Comboitem item = combo.appendItem(_(role.getDisplayName()));
|
||||
item.setValue(role);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue