fixed bug happenign with firefox and Chrome when click back browser button (let previous scope set)

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/vre-members@100221 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2014-09-26 13:26:40 +00:00
parent fe282c3abf
commit e7ca38ed56
3 changed files with 34 additions and 15 deletions

View File

@ -41,11 +41,15 @@ public class VREMembersPanel extends Composite {
mainPanel.clear(); mainPanel.clear();
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT); mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
Grid grid = new Grid(users.size()/4+1, 4); if (users == null || users.isEmpty()) {
mainPanel.add(grid); mainPanel.add(new HTML("<div class=\"frame\" style=\"font-size: 16px;\">Ops, something went wrong. Please <a href=\"javascript: location.reload();\">reload<a/> this page.</div>"));
} else {
Grid grid = new Grid(users.size()/4+1, 4);
mainPanel.add(grid);
for (int i = 0; i < users.size(); i++) { for (int i = 0; i < users.size(); i++) {
grid.setWidget(i/4, i%4, new DisplayBadge(users.get(i))); grid.setWidget(i/4, i%4, new DisplayBadge(users.get(i)));
}
} }
} }

View File

@ -44,6 +44,7 @@ public class MembersServiceImpl extends RemoteServiceServlet implements MembersS
user = getDevelopmentUser(); user = getDevelopmentUser();
SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube"); SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube");
} }
System.out.println("\n\n\n RealPath->" + this.getServletContext().getRealPath(""));
return SessionManager.getInstance().getASLSession(sessionID, user); return SessionManager.getInstance().getASLSession(sessionID, user);
} }
/** /**
@ -88,8 +89,10 @@ public class MembersServiceImpl extends RemoteServiceServlet implements MembersS
ScopeBean sb = new ScopeBean(scope); ScopeBean sb = new ScopeBean(scope);
List<UserModel> users = null; List<UserModel> users = null;
if (sb.is(Type.INFRASTRUCTURE)) if (sb.is(Type.INFRASTRUCTURE)) {
users = um.listUsersByGroup(gm.getRootVO().getGroupId()); users = new ArrayList<UserModel>();
return new ArrayList<BelongingUser>();
}
else if (sb.is(Type.VRE)) { //must be in VRE else if (sb.is(Type.VRE)) { //must be in VRE
//get the name from the scope //get the name from the scope
String orgName = scope.substring(scope.lastIndexOf("/")+1, scope.length()); String orgName = scope.substring(scope.lastIndexOf("/")+1, scope.length());
@ -137,4 +140,5 @@ public class MembersServiceImpl extends RemoteServiceServlet implements MembersS
} }
} }

View File

@ -11,6 +11,17 @@
border: 1px solid #DBDBDB; border: 1px solid #DBDBDB;
} }
.frame {
font-family: 'Helvetica Neue', Arial, sans-serif;
padding: 10px;
margin: 10px;
background: #FFF;
border-radius: 6px !important;
-moz-border-radius: 6px !important;
-webkit-border-radius: 6px !important;
border: 1px solid #DBDBDB;
}
.user-photo { .user-photo {
padding: 5px; padding: 5px;
border: 1px solid #E6E6E6; border: 1px solid #E6E6E6;