Esempio n. 1
0
    public EnterGameForm(String id, IModel model) {
      super(id, model);

      Game game = (Game) getModelObject();
      Week week = game.getWeek();
      // LeagueType leagueType = week.getLeagueType();
      // List<Team> teams = teamManager.getTeamsByLeagueType(leagueType);
      List<Team> teams = teamManager.getUnenteredTeamsForWeek(week);
      final DropDownChoice fav =
          new DropDownChoice("fav", teams, new ChoiceRenderer("fullTeamName", "id"));
      fav.setRequired(true);
      add(fav);

      final DropDownChoice dog =
          new DropDownChoice("dog", teams, new ChoiceRenderer("fullTeamName", "id"));
      dog.setRequired(true);
      add(dog);

      RequiredTextField spread = new RequiredTextField("spread", Double.class);
      add(spread);

      CheckBox favHome = new CheckBox("favHome");
      add(favHome);

      add(new DateTimeField("gameStart"));

      add(new Button("submit"));
    }
  public BranchSelectionPanel(
      String id,
      IModel<String> repositoryUriModel,
      IModel<String> branchNameModel,
      Form<DataStoreInfo> storeEditForm) {
    super(id, branchNameModel);
    this.repositoryUriModel = repositoryUriModel;

    final List<String> choices = new ArrayList<String>();
    choice = new DropDownChoice<String>("branchDropDown", branchNameModel, choices);
    choice.setOutputMarkupId(true);
    choice.setNullValid(true);
    choice.setRequired(false);
    add(choice);
    updateChoices(false, null);

    final AjaxSubmitLink refreshLink =
        new AjaxSubmitLink("refresh", storeEditForm) {
          private static final long serialVersionUID = 1L;

          @Override
          protected void onError(AjaxRequestTarget target, Form<?> form) {
            onSubmit(target, form);
          }

          @Override
          protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            updateChoices(true, form);
            target.add(BranchSelectionPanel.this.choice);
          }
        };
    add(refreshLink);
  }
Esempio n. 3
0
 /*
  * (non-Javadoc)
  *
  * @see au.org.theark.core.web.form.AbstractDetailForm#attachValidators()
  */
 @Override
 protected void attachValidators() {
   areaCodeTxtFld.add(StringValidator.maximumLength(10));
   phoneTypeChoice
       .setRequired(true)
       .setLabel(
           (new StringResourceModel(
               "phone.phoneType.required", this, new Model<String>("Phone Type"))));
   phoneNumberTxtFld
       .setRequired(true)
       .setLabel(
           (new StringResourceModel(
               "phone.phoneNumber.required", this, new Model<String>("Phone Number"))));
   phoneStatusChoice
       .setRequired(true)
       .setLabel(
           (new StringResourceModel(
               "phone.phoneStatus.required", this, new Model<String>("Phone Status"))));
   phoneNumberTxtFld.add(StringValidator.maximumLength(20));
   dateReceivedDp
       .add(DateValidator.maximum(new Date()))
       .setLabel(new StringResourceModel("phone.dateReceived.DateValidator.maximum", this, null));
 }
Esempio n. 4
0
  protected void createDepartmentInput(Form<T> form) {
    Fragment f = new Fragment("dept", "department", this);

    DropDownChoice<UserDepartment> userDepartment =
        new DropDownChoice<UserDepartment>(
            "user.userDepartment",
            getUserDepartments(),
            new ChoiceRenderer<UserDepartment>("name"));
    userDepartment.setRequired(true);
    userDepartment.setLabel(new ResourceModel("admin.user.department"));
    userDepartment.add(new ValidatingFormComponentAjaxBehavior());
    f.add(userDepartment);
    f.add(new AjaxFormComponentFeedbackIndicator("departmentValidationError", userDepartment));
    form.add(f);
  }
Esempio n. 5
0
  @Override
  public void onInitialize() {
    super.onInitialize();

    changeRequest = new CCRequest();
    changeRequest.getToCourses().add("");

    final Form changeForm = new Form("changePanel");
    add(changeForm);

    final MarkupContainer rowPanel = new WebMarkupContainer("rowsPanel");
    rowPanel.setOutputMarkupId(true);
    changeForm.add(rowPanel);

    final ListView<String> lv =
        new ListView<String>("rows", new PropertyModel<List<String>>(changeRequest, "toCourses")) {

          @Override
          protected void populateItem(ListItem<String> item) {
            TextField text = new TextField("text", item.getModel());
            item.add(text);
          }
        };

    rowPanel.add(lv.setReuseItems(true));

    AjaxButton addButton =
        new AjaxButton("addRow", changeForm) {

          @Override
          protected void onSubmit(AjaxRequestTarget target, Form form) {
            lv.getModelObject().add("");
            if (target != null) {
              target.addComponent(rowPanel);
            }
          }
        };
    addButton.setDefaultFormProcessing(false);
    rowPanel.add(addButton);

    final ChoiceRenderer cr = new ChoiceRenderer("name", "id");
    final DropDownChoice<Lesson> ddc =
        new DropDownChoice<Lesson>(
            "lessons",
            new PropertyModel<Lesson>(changeRequest, "lesson"),
            LessonManager.getInstance().getLessons(),
            cr);
    changeForm.add(ddc.setRequired(true));
    changeForm.add(new RequiredTextField("from", new PropertyModel(changeRequest, "fromCourse")));
    Button send =
        new Button("btn1", Model.of("Elküldés")) {

          @Override
          public void onSubmit() {
            super.onSubmit();

            changeRequest.setUser(userManager.find(getUserId()));
            changeRequest.setStatus(CCRequest.Status.New);

            CourseManager.getInstance().insertRequest(changeRequest);
            log.warn(changeRequest.toString());
          }
        };

    changeForm.add(send);
  }
  protected void initUI(StyleInfo style) {
    IModel<StyleInfo> styleModel =
        new CompoundPropertyModel(
            style != null
                ? new StyleDetachableModel(style)
                : getCatalog().getFactory().createStyle());

    styleForm =
        new Form("form", styleModel) {
          @Override
          protected void onSubmit() {
            super.onSubmit();
            onStyleFormSubmit();
          }
        };
    styleForm.setMarkupId("mainForm");
    add(styleForm);

    styleForm.add(nameTextField = new TextField("name"));
    nameTextField.setRequired(true);

    DropDownChoice<WorkspaceInfo> wsChoice =
        new DropDownChoice("workspace", new WorkspacesModel(), new WorkspaceChoiceRenderer());
    wsChoice.setNullValid(true);
    if (!isAuthenticatedAsAdmin()) {
      wsChoice.setNullValid(false);
      wsChoice.setRequired(true);
    }

    styleForm.add(wsChoice);
    styleForm.add(editor = new CodeMirrorEditor("SLD", new PropertyModel(this, "rawSLD")));
    // force the id otherwise this blasted thing won't be usable from other forms
    editor.setTextAreaMarkupId("editor");
    editor.setOutputMarkupId(true);
    editor.setRequired(true);
    styleForm.add(editor);

    if (style != null) {
      try {
        setRawSLD(readFile(style));
      } catch (IOException e) {
        // ouch, the style file is gone! Register a generic error message
        Session.get()
            .error(new ParamResourceModel("sldNotFound", this, style.getFilename()).getString());
      }
    }

    // style copy functionality
    styles =
        new DropDownChoice(
            "existingStyles", new Model(), new StylesModel(), new StyleChoiceRenderer());
    styles.setOutputMarkupId(true);
    styles.add(
        new AjaxFormComponentUpdatingBehavior("onchange") {

          @Override
          protected void onUpdate(AjaxRequestTarget target) {
            styles.validate();
            copyLink.setEnabled(styles.getConvertedInput() != null);
            target.addComponent(copyLink);
          }
        });
    styleForm.add(styles);
    copyLink = copyLink();
    copyLink.setEnabled(false);
    styleForm.add(copyLink);

    uploadForm = uploadForm(styleForm);
    uploadForm.setMultiPart(true);
    uploadForm.setMaxSize(Bytes.megabytes(1));
    uploadForm.setMarkupId("uploadForm");
    add(uploadForm);

    uploadForm.add(fileUploadField = new FileUploadField("filename"));

    add(validateLink());
    Link cancelLink =
        new Link("cancel") {
          @Override
          public void onClick() {
            setResponsePage(StylePage.class);
          }
        };
    add(cancelLink);
  }
Esempio n. 7
0
  public UserAdminFormPanel(
      String id,
      CompoundPropertyModel<UserBackingBean> userModel,
      List<UserRole> roles,
      List<UserDepartment> departments) {
    super(id, userModel);

    GreySquaredRoundedBorder greyBorder = new GreySquaredRoundedBorder(BORDER);
    add(greyBorder);

    setOutputMarkupId(true);

    final Form<UserBackingBean> form = new Form<UserBackingBean>(FORM, userModel);

    // username
    RequiredTextField<String> usernameField = new RequiredTextField<String>("user.username");
    form.add(usernameField);
    usernameField.add(new StringValidator(0, 32));
    usernameField.add(new DuplicateUsernameValidator());
    usernameField.setLabel(new ResourceModel("admin.user.username"));
    usernameField.add(new ValidatingFormComponentAjaxBehavior());
    form.add(new AjaxFormComponentFeedbackIndicator("userValidationError", usernameField));

    // user info
    TextField<String> firstNameField = new TextField<String>("user.firstName");
    form.add(firstNameField);

    TextField<String> lastNameField = new RequiredTextField<String>("user.lastName");
    form.add(lastNameField);
    lastNameField.setLabel(new ResourceModel("admin.user.lastName"));
    lastNameField.add(new ValidatingFormComponentAjaxBehavior());
    form.add(new AjaxFormComponentFeedbackIndicator("lastNameValidationError", lastNameField));

    form.add(new EmailInputSnippet("email"));

    // password
    Label label = new Label("passwordEditLabel", new ResourceModel("admin.user.editPassword"));
    label.setVisible(userModel.getObject().getAdminAction() == AdminAction.EDIT);
    form.add(label);

    PasswordFieldFactory.createOptionalPasswordFields(
        form, new PropertyModel<String>(userModel, "user.password"));

    // department
    DropDownChoice<UserDepartment> userDepartment =
        new DropDownChoice<UserDepartment>(
            "user.userDepartment", departments, new ChoiceRenderer<UserDepartment>("name"));
    userDepartment.setRequired(true);
    userDepartment.setLabel(new ResourceModel("admin.user.department"));
    userDepartment.add(new ValidatingFormComponentAjaxBehavior());
    form.add(userDepartment);
    form.add(new AjaxFormComponentFeedbackIndicator("departmentValidationError", userDepartment));

    // user roles
    ListMultipleChoice<UserRole> userRoles =
        new ListMultipleChoice<UserRole>("user.userRoles", roles, new UserRoleRenderer());
    userRoles.setMaxRows(4);
    userRoles.setLabel(new ResourceModel("admin.user.roles"));
    userRoles.setRequired(true);
    userRoles.add(new ValidatingFormComponentAjaxBehavior());
    form.add(userRoles);
    form.add(new AjaxFormComponentFeedbackIndicator("rolesValidationError", userRoles));

    // active
    form.add(new CheckBox("user.active"));

    // data save label
    form.add(new ServerMessageLabel("serverMessage", "formValidationError"));

    boolean deletable = userModel.getObject().getUser().isDeletable();

    FormConfig formConfig =
        new FormConfig()
            .forForm(form)
            .withDelete(deletable)
            .withSubmitTarget(this)
            .withDeleteEventType(UserEditAjaxEventType.USER_DELETED)
            .withSubmitEventType(UserEditAjaxEventType.USER_UPDATED);

    FormUtil.setSubmitActions(formConfig);

    greyBorder.add(form);
  }
  @SuppressWarnings("serial")
  @Override
  protected void init() {
    super.init();
    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("plugins.teamcal.event.teamCal"));
      final List<TeamCalDO> list = teamCalDao.getAllCalendarsWithFullAccess();
      final LabelValueChoiceRenderer<TeamCalDO> calChoiceRenderer =
          new LabelValueChoiceRenderer<TeamCalDO>();
      for (final TeamCalDO cal : list) {
        calChoiceRenderer.addValue(cal, cal.getTitle());
      }
      final DropDownChoice<TeamCalDO> calDropDownChoice =
          new DropDownChoice<TeamCalDO>(
              fs.getDropDownChoiceId(),
              new PropertyModel<TeamCalDO>(this, "calendar"),
              calChoiceRenderer.getValues(),
              calChoiceRenderer) {
            /**
             * @see
             *     org.apache.wicket.markup.html.form.DropDownChoice#wantOnSelectionChangedNotifications()
             */
            @Override
            protected boolean wantOnSelectionChangedNotifications() {
              return true;
            }

            /**
             * @see
             *     org.apache.wicket.markup.html.form.DropDownChoice#onSelectionChanged(java.lang.Object)
             */
            @Override
            protected void onSelectionChanged(final TeamCalDO newSelection) {
              parentPage.reconcile();
            }
          };
      calDropDownChoice.setNullValid(false);
      calDropDownChoice.setRequired(true);
      fs.add(calDropDownChoice);
    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.ics");
      fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
      fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
      fs.add(
          new SingleButtonPanel(
                  fs.newChildId(),
                  new Button(SingleButtonPanel.WICKET_ID, new Model<String>("importEvents")) {
                    @Override
                    public final void onSubmit() {
                      parentPage.importEvents();
                    }
                  },
                  getString("upload"),
                  SingleButtonPanel.NORMAL)
              .setTooltip(getString("common.import.upload.tooltip")));
      addClearButton(fs);
    }
    {
      addImportFilterRadio(gridBuilder);
    }
    gridBuilder.newGridPanel();
    final DivPanel panel = gridBuilder.getPanel();
    storagePanel = new TeamCalImportStoragePanel(panel.newChildId(), parentPage, importFilter);
    panel.add(storagePanel);
  }
Esempio n. 9
0
  public OldNewReleasePage(PageParameters pp, String info) {
    super(pp, info);

    setActiveMenu(Menu.RELEASES);
    add(new FeedbackPanel("feedbackMessage"));

    Form newReleaseForm =
        new Form("form-newrelease", new CompoundPropertyModel(newRelease)) {
          @Override
          protected void onSubmit() {
            System.out.println("Submit: " + newRelease);
            PVTDataAccessObject dao = PVTApplication.getDAO();
            dao.getPvtModel().addRelease(newRelease);
            dao.persist();

            setResponsePage(new ReleasesPage(pp, "Release: " + newRelease.getName() + " Created."));
          }
        };

    List<String> productNames = new ArrayList<>();
    for (Product p : PVTApplication.getDAO().getPvtModel().getProducts()) {
      productNames.add(p.getName());
    }

    DropDownChoice<String> productDropDownChoice =
        new DropDownChoice<String>(
            "productName",
            Model.ofList(productNames),
            new ChoiceRenderer<String>("toString", "toString") {}) {
          @Override
          public boolean isNullValid() {
            return true;
          }
        };
    productDropDownChoice.setRequired(true);
    newReleaseForm.add(productDropDownChoice);

    TextField<String> nameTextField = new TextField<String>("name");
    nameTextField.setRequired(true);

    newReleaseForm.add(nameTextField);
    newReleaseForm.add(new TextArea<String>("distributions"));
    newReleaseForm.add(new TextArea<String>("description"));
    newReleaseForm.add(
        new CheckBoxMultipleChoice<String>(
            "jobs",
            Model.ofList(
                Arrays.asList("ZipDiff", "Version convention", "JDK version compatible"))));

    newReleaseForm.add(
        new IFormValidator() {
          public FormComponent<?>[] getDependentFormComponents() {
            return new FormComponent[] {nameTextField, productDropDownChoice};
          }

          public void validate(Form<?> form) {
            PVTDataAccessObject dao = PVTApplication.getDAO();
            boolean existed = false;
            for (Release rel : dao.getPvtModel().getReleases()) {
              if (rel.getName().equalsIgnoreCase(nameTextField.getInput())
                  && rel.getProductId().equalsIgnoreCase(productDropDownChoice.getInput())) {
                existed = true;
                break;
              }
            }
            if (existed) {
              ValidationError error = new ValidationError();
              error.setMessage(
                  "The Release "
                      + productDropDownChoice.getInput()
                      + "-"
                      + nameTextField.getInput()
                      + " is already existed");
              nameTextField.error(error);
            }
          }
        });

    add(newReleaseForm);
  }
  private void init() {
    feedback.setOutputMarkupId(true);
    add(feedback);
    CompoundPropertyModel model = new CompoundPropertyModel(new Adherent());
    setModel(model);

    add(new RequiredTextField<String>("nom").add(new FocusOnLoadBehavior()));
    add(new RequiredTextField<String>("prenom"));
    add(
        new RequiredTextField<String>("numeroLicense", String.class)
            .add(new PatternValidator("\\d{6}")));

    // numéro de téléphone au bon format (10 caractères numériques)
    RequiredTextField<String> telephone = new RequiredTextField<String>("telephone", String.class);
    telephone.add(ExactLengthValidator.exactLength(10));
    telephone.add(new PatternValidator("\\d{10}"));
    add(telephone);

    add(new RequiredTextField<String>("mail").add(EmailAddressValidator.getInstance()));

    // Ajout de la liste des niveaux
    List<String> niveaux = new ArrayList<String>();
    for (NiveauAutonomie n : NiveauAutonomie.values()) {
      niveaux.add(n.toString());
    }
    add(new DropDownChoice("niveau", niveaux));

    // Ajout de la liste des aptitudes
    List<String> aptitudes = new ArrayList<String>();
    for (Aptitude apt : Aptitude.values()) {
      aptitudes.add(apt.name());
    }
    add(new DropDownChoice("aptitude", aptitudes));

    // Ajout de la liste des niveaux d'encadrement
    List<String> encadrement = new ArrayList<String>();
    for (Adherent.Encadrement e : Adherent.Encadrement.values()) {
      encadrement.add(e.toString());
    }
    add(new DropDownChoice("encadrement", encadrement));

    // Ajout de la checkbox pilote
    add(new CheckBox("pilote", model.bind("pilote")));

    // Ajout des roles
    List<String> roles =
        Arrays.asList(new String[] {"ADMIN", "USER", "SECRETARIAT", "DP", "ENCADRANT"});
    add(new ListMultipleChoice<String>("roles", roles));

    // Ajout du champs date du certificat medical
    DateTextField dateCMTextFiled =
        new DateTextField(
            "dateCM", new PropertyModel<Date>(model, "dateCM"), new StyleDateConverter("S-", true));
    dateCMTextFiled.setRequired(true);
    add(dateCMTextFiled);
    dateCMTextFiled.add(new DatePicker());

    Date dateDuJour = new Date();
    GregorianCalendar gc = new GregorianCalendar();
    gc.setTime(dateDuJour);
    int anneeCourante = gc.get(Calendar.YEAR);
    int nextAnnee = anneeCourante + 1;

    List<Integer> annees = new ArrayList<Integer>();
    annees.add(new Integer(anneeCourante));
    annees.add(new Integer(nextAnnee));

    DropDownChoice<Integer> listAnnee = new DropDownChoice<Integer>("anneeCotisation", annees);
    listAnnee.setRequired(true);
    add(listAnnee);

    // Ajout de la checkbox TIV
    add(new CheckBox("tiv", model.bind("tiv")));
    // commentaire
    TextArea<String> textareaInput = new TextArea<String>("commentaire");
    textareaInput.add(ExactLengthValidator.maximumLength(45));
    add(textareaInput);

    ContactPanel cuPanel = new ContactPanel("cuPanel", model);
    add(cuPanel);

    add(
        new AjaxButton("validAdherent") {
          @Override
          protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            Adherent adherent = (Adherent) form.getModelObject();
            try {

              ResaSession.get().getAdherentService().creerAdherent(adherent);

              setResponsePage(AccueilPage.class);
            } catch (TechnicalException e) {
              e.printStackTrace();
              error(e.getKey());
            }
          }
          // L'implémentation de cette méthode est nécessaire pour voir
          // les messages d'erreur dans le feedBackPanel

          @Override
          protected void onError(AjaxRequestTarget target, Form<?> form) {
            target.addComponent(feedback);
          }
        });

    add(
        new Link("cancel") {
          @Override
          public void onClick() {
            setResponsePage(AccueilPage.class);
          }
        });
  }
    public UserDetailForm(final String id) {
      super(id);

      name = new TextField("name", new PropertyModel(properties, "name"));
      name.setRequired(true);
      name.setModelValue(user.getName());
      add(name);
      //	add(nameFeedback = new ComponentFeedbackPanel("nameFeedback",
      //			name));
      add(new Label("nameLabel", "Meno"));
      add(new FormComponentFeedbackBorder("border").add(name));

      surname = new TextField("surname", new PropertyModel(properties, "surname"));
      surname.setRequired(true);
      surname.setModelValue(user.getSurname());
      add(surname);
      //	add(surnameFeedback = new ComponentFeedbackPanel("surnameFeedback",
      //		surname));
      add(new Label("surnameLabel", "Priezvisko"));

      email = new TextField("email", new PropertyModel(properties, "email"));
      email.setRequired(true);
      email.setModelValue(user.getEmail());
      email.setEnabled(false);
      add(email);
      //	 			add(addressFeedback = new ComponentFeedbackPanel("addressFeedback",
      //	 					address));
      add(new Label("emailLabel", "Email"));

      login = new TextField("login", new PropertyModel(properties, "login"));
      login.setRequired(true);
      login.setModelValue(user.getLogin());
      login.setEnabled(false);
      add(login);
      //	 			add(loginNameFeedback = new ComponentFeedbackPanel("loginNameFeedback",
      //	 					loginName));
      add(new Label("loginLabel", "Login"));

      //	 			region= new TextField("region", new PropertyModel(properties,
      //	 					"region"));
      //	 			region.setRequired(false);
      //	 			region.setModelValue(user.getRegion());
      //	 			add(region);
      //	 			add(new Label("regionLabel","Region"));

      County mesto = new County();
      town = new DropDownChoice("town", new PropertyModel(mesto, "name"), TOWN_LIST);
      town.setRequired(false);
      if (user.getTown() != null) mesto.setName(user.getTown().getName());
      add(town);
      add(new Label("townLabel", "Town"));

      HandicapType postihnutie = new HandicapType();
      handicapType =
          new DropDownChoice(
              "handicapType", new PropertyModel(postihnutie, "name"), HANDICAPTYPE_LIST);
      handicapType.setRequired(false);
      if (user.getHandicapType() != null) postihnutie.setName(user.getHandicapType().getName());
      add(handicapType);
      add(new Label("handicapTypeLabel", "Handicap"));

      preferRegion = new CheckBox("preferRegion", new PropertyModel(properties, "preferRegion"));

      add(preferRegion);
      add(new Label("preferRegionLabel", "Preferujem"));

      add(new Label("registrationDateLabel", "Dátum registrácie:"));
      add(new Label("userRegistrationDateLabel", dateFormat.format(user.getRegistrationDate())));

      password = new PasswordTextField("password", new PropertyModel(properties, "password"));
      add(password);
      password.setRequired(false);
      //	 			add(passwordFeedback = new ComponentFeedbackPanel(
      //	 					"passwordFeedback", password));
      add(new Label("passwordLabel", "Heslo:"));

      passwordAgain =
          new PasswordTextField("passwordAgain", new PropertyModel(properties, "passwordAgain"));
      add(passwordAgain);
      passwordAgain.setRequired(false);
      //	 			add(passwordAgainFeedback = new ComponentFeedbackPanel("passwordAgainFeedback",
      //	 					passwordAgain));
      add(new Label("passwordAgainLabel", "Heslo znova"));

      add(submit = new Button("submit", new ResourceModel("button.submit")));
      //	 			add(submitFeedback = new ComponentFeedbackPanel("submitFeedback",
      //	 					submit));
    }
  /** @param ruleId */
  private void addNewComponentForm(final Integer ruleId) {
    IModel<DNRuleComponent> formModel =
        new CompoundPropertyModel<DNRuleComponent>(new DNRuleComponent());

    Form<DNRuleComponent> form =
        new Form<DNRuleComponent>("newDNRuleComponentForm", formModel) {
          private static final long serialVersionUID = 1L;

          @Override
          protected void onSubmit() {
            DNRuleComponent dnRuleComponent = this.getModelObject();
            dnRuleComponent.setRuleId(ruleId);

            try {
              dnRuleComponentDao.save(dnRuleComponent);
            } catch (DaoException ex) {
              logger.error(ex.getMessage(), ex);
              getSession().error(ex.getMessage());
              return;
            } catch (Exception ex) {
              logger.error(ex.getMessage(), ex);
              getSession()
                  .error("The component could not be registered due to an unexpected error.");

              return;
            }

            getSession().info("The component was successfuly registered.");
            setResponsePage(new DNRuleDetailPage(ruleId));
          }
        };

    final TextArea<String> modification = new TextArea<String>("modification");

    ChoiceRenderer<DNRuleComponentType> renderer =
        new ChoiceRenderer<DNRuleComponentType>("label", "id");
    LoadableDetachableModel<List<DNRuleComponentType>> choices =
        new LoadableDetachableModel<List<DNRuleComponentType>>() {
          private static final long serialVersionUID = 1L;

          @Override
          protected List<DNRuleComponentType> load() {
            return dnRuleComponentTypeDao.loadAll();
          }
        };
    DropDownChoice<DNRuleComponentType> type =
        new DropDownChoice<DNRuleComponentType>("type", choices, renderer) {
          private static final long serialVersionUID = 1L;

          @Override
          public void onSelectionChanged(DNRuleComponentType newType) {
            String hint;

            if (newType.getLabel().equals("INSERT")) {

              hint = insertHint;

            } else if (newType.getLabel().equals("DELETE")) {

              hint = deleteHint;

            } else {

              hint = modifyHint;
            }

            modification.add(new AttributeModifier("placeholder", hint));
          }

          @Override
          protected boolean wantOnSelectionChangedNotifications() {
            return true;
          }

          @Override
          protected CharSequence getDefaultChoice(String selectedValue) {
            return !isNullValid() && !getChoices().isEmpty()
                ? ""
                : super.getDefaultChoice(selectedValue);
          }
        };
    type.setNullValid(false);
    type.setRequired(true);
    form.add(type);

    modification.setRequired(true);
    modification.add(
        new DNComponentValidator(
            ConfigLoader.getConfig().getBackendGroup().getDirtyDBJDBCConnectionCredentials(),
            type));
    modification.add(new AttributeModifier("placeholder", insertHint));
    form.add(modification);

    form.add(createTextarea("description", false));

    add(form);
  }