Package org.apache.wicket.markup.html.form

Examples of org.apache.wicket.markup.html.form.FormComponentLabel


        checkBox = createCheckBox(ID_SCALAR_VALUE);

        checkBox.setLabel(Model.of(name));

        final FormComponentLabel labelIfRegular = new FormComponentLabel(ID_SCALAR_IF_REGULAR, checkBox);
        labelIfRegular.add(checkBox);
        if(getModel().isRequired()) {
            labelIfRegular.add(new CssClassAppender("mandatory"));
        }

        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }
       
        final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(checkBox));
        labelIfRegular.add(scalarName);

        addOrReplace(labelIfRegular);
       
        addFeedbackTo(labelIfRegular, checkBox);
        addAdditionalLinksTo(labelIfRegular);
View Full Code Here


       
        setOutputMarkupId(true);
        entityLink.setOutputMarkupId(true);
        entityLink.setLabel(Model.of(name));
       
        final FormComponentLabel labelIfRegular = new FormComponentLabel(ID_SCALAR_IF_REGULAR, entityLink);
        labelIfRegular.add(entityLink);
       
        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }
       
        final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(entityLink));
        labelIfRegular.add(scalarName);
       
        addOrReplace(labelIfRegular);
       
        addFeedbackTo(labelIfRegular, entityLink);
        addAdditionalLinksTo(labelIfRegular);
       
        addStandardSemantics();
        addSemantics();

        if(getModel().isRequired()) {
            labelIfRegular.add(new CssClassAppender("mandatory"));
        }
        return labelIfRegular;
    }
View Full Code Here

        entityLink = (EntityLinkSelect2Panel) entityLinkComponent;
       
        entityLink.setOutputMarkupId(true);
        entityLink.setLabel(Model.of(name));
       
        final FormComponentLabel labelIfCompact = new FormComponentLabel(ID_SCALAR_IF_COMPACT, entityLink);
        labelIfCompact.add(entityLink);
       
        addOrReplace(labelIfCompact);
       
        return labelIfCompact;
    }
View Full Code Here

      super(id);
      add(new FeedbackPanel("login-feedback"));
      add((new FormComponentFeedbackBorder("username-border")).add(username = new RequiredTextField<String>("username", new Model<String>())));
      add((new FormComponentFeedbackBorder("password-border")).add(password = new PasswordTextField("password", new Model<String>())));
      password.setRequired(true);
      FormComponentLabel usernameLabel =  (new FormComponentLabel("usernameLabel", username));
      add(usernameLabel);
      FormComponentLabel passwordLabel =  (new FormComponentLabel("passwordLabel", password));
      add(passwordLabel);
    }
View Full Code Here

    };
    form.setOutputMarkupPlaceholderTag(true);
    TextArea<String> messageField = new TextArea<String>("message");
    messageField.setRequired(true);
    form.add(messageField);
    form.add(new FormComponentLabel("messageLabel", messageField));
    final FeedbackPanel feedbackPanel = new ComponentFeedbackPanel("feedbackPanel", form);
    feedbackPanel.setOutputMarkupPlaceholderTag(true);
    form.add(feedbackPanel);
    AjaxSubmitLink sendLink = new AjaxSubmitLink("send") {
      private static final long serialVersionUID = 1L;
View Full Code Here

      super(id);
      TextArea<String> questionTextArea = new TextArea<String>("text", textModel);
      questionTextArea.add(new QuestionNameValidator(null))
          .setRequired(true)
          .add(new SimpleAttributeModifier("maxlength", "250"));
      add(new FormComponentLabel("questionLabel", questionTextArea));
      add(questionTextArea);
      add(new AjaxButton("submit") {
        private static final long serialVersionUID = 1L;

        @Override
View Full Code Here

        target.addComponent(periodChoice);
        PeriodStudentSelectPanel.this.onPeriodUpdate(target)// Subclass defined actions
     
    });
    // make sure the label is linked to the period dropdown   
    FormComponentLabel periodChoiceLabel = (new FormComponentLabel("periodChoiceLabel", periodChoice));
    periodStudentSelectForm.add(periodChoiceLabel);
    periodStudentSelectForm.add(periodChoice);
   
    // Student Chooser
    IModel<User> studentModel = ISISession.get().getStudentModel();
    if (studentModel == null) {
      studentModel = new HibernateObjectModel<User>(User.class);
    }
    studentChoice = new UserChoice("studentChoice", studentModel, getUserListModel());
    if (studentChoice.getModelObject() == null) { // If session did not have a student or student was not in the session's period, reset session's student
      ISISession.get().setStudentModel(null);
    }
    studentChoice.setOutputMarkupId(true);
   
    // Set Student onChange Behavior
    studentChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onUpdate(AjaxRequestTarget target) {
        ISISession.get().setStudentModel(studentChoice.getModel()); // Save student change in session
        target.addComponent(feedback);
        target.addComponent(studentChoice);
        PeriodStudentSelectPanel.this.onStudentUpdate(target)// Subclass defined actions
      }     
    });   
    if(!showStudents) {
      studentChoice.setVisible(false);
    }
    // make sure the label is linked to the student dropdown   
    FormComponentLabel studentChoiceLabel = (new FormComponentLabel("studentChoiceLabel", studentChoice));
    periodStudentSelectForm.add(studentChoiceLabel);
      periodStudentSelectForm.add(studentChoice);
   
      feedback = new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(periodStudentSelectForm));
      feedback.setOutputMarkupId(true);
View Full Code Here

  public SingleSelectItem(String id, IModel<String> model, boolean correct) {
    super(id, model);
    this.correct = correct;
    final Radio<String> radio = new Radio<String>("radio", model);
    add(radio);
    add(new FormComponentLabel("label", radio));
    radio.add(new AjaxEventBehavior("onclick"){

      private static final long serialVersionUID = 1L;

      @Override
View Full Code Here

    else
      numberModel = new Model<String>("");
    TextField<String> numberField = new TextField<String>("numberField", numberModel);
    add(numberField);
    if (addLabel) {
      FormComponentLabel numberFieldLabel =  new FormComponentLabel("numberFieldLabel", numberField);
      add(numberFieldLabel);
    }
    add(new SubmitLink("goLink"));
 
View Full Code Here

        } else {
            select2Field.clearInput();
        }


        final FormComponentLabel labelIfRegular = createFormComponentLabel();
        if(getModel().isRequired()) {
            labelIfRegular.add(new CssClassAppender("mandatory"));
        }
       
        addOrReplace(labelIfRegular);
        addFeedbackTo(labelIfRegular, select2Field);
        addAdditionalLinksTo(labelIfRegular);
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.form.FormComponentLabel

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.