break; default: p = new HeaderPanel("panel"); container.addOrReplace(new HeaderPanel("panel")); if (RoleSource.UserGroupService.equals(rs)) container.addOrReplace(new UserGroupServicePanel("panel"));
break; default: p = new HeaderPanel("panel"); container.addOrReplace(new HeaderPanel("panel")); if (RoleSource.UserGroupService.equals(rs)) container.addOrReplace(new UserGroupServicePanel("panel"));
@Override protected void onUpdate(AjaxRequestTarget target) { Panel p; switch(roleSourceChoice.getModelObject()) { case UserGroupService: p = new UserGroupServicePanel("panel"); break; case RoleService: p = new RoleServicePanel("panel"); break; default: p = new HeaderPanel("panel"); } WebMarkupContainer c = (WebMarkupContainer)get("container"); c.addOrReplace(p); target.addComponent(c); } });
@Override protected void onUpdate(AjaxRequestTarget target) { Panel p; switch(roleSourceChoice.getModelObject()) { case UserGroupService: p = new UserGroupServicePanel("panel"); break; case RoleService: p = new RoleServicePanel("panel"); break; default: p = new HeaderPanel("panel"); } WebMarkupContainer c = (WebMarkupContainer)get("container"); c.addOrReplace(p); target.addComponent(c); } });
protected Panel getRoleSourcePanel(RoleSource model) { if (PreAuthenticatedUserNameRoleSource.UserGroupService.equals(model)) { return new UserGroupServicePanel("panel"); } else if (PreAuthenticatedUserNameRoleSource.RoleService.equals(model)) { return new RoleServicePanel("panel"); } else if (PreAuthenticatedUserNameRoleSource.Header.equals(model)) { return new HeaderPanel("panel"); } return new EmptyPanel("panel"); }