Package fr.openwide.maven.artifact.notifier.web.application.common.component

Examples of fr.openwide.maven.artifact.notifier.web.application.common.component.UserGroupAutocompleteAjaxComponent


    });
   
    // Add group form
    IModel<UserGroup> emptyUserGroupModel = new GenericEntityModel<Long, UserGroup>(null);
   
    final UserGroupAutocompleteAjaxComponent userGroupAutocomplete = new UserGroupAutocompleteAjaxComponent(
        "userGroupAutocomplete", emptyUserGroupModel);
    userGroupAutocomplete.setAutoUpdate(true);
   
    final Form<UserGroup> addGroupForm = new Form<UserGroup>("addGroupForm", emptyUserGroupModel);
    addGroupForm.add(userGroupAutocomplete);
    addGroupForm.add(new AjaxSubmitLink("addGroupLink", addGroupForm) {
      private static final long serialVersionUID = 6935376642872117563L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        User user = UserMembershipsPanel.this.getModelObject();
        UserGroup selectedUserGroup = userGroupAutocomplete.getModelObject();
       
        if (selectedUserGroup != null) {
          try {
            userGroupService.addUser(selectedUserGroup, user);
            getSession().success(getString("administration.usergroup.members.add.success"));
          } catch (Exception e) {
            LOGGER.error("Unknown error occured while adding a user to a usergroup", e);
            getSession().error(getString("administration.usergroup.members.add.error"));
          }
        }
        userGroupAutocomplete.setModelObject(null);
        target.add(getPage());
        FeedbackUtils.refreshFeedback(target, getPage());
      }
     
      @Override
View Full Code Here

TOP

Related Classes of fr.openwide.maven.artifact.notifier.web.application.common.component.UserGroupAutocompleteAjaxComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.