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

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


        protected void populateItem(ListItem<String> item)
        {
          Radio<String> radio = new Radio<>("radio", item.getModel());
          radio.setLabel(item.getModel());
          item.add(radio);
          item.add(new SimpleFormComponentLabel("number", radio));
        }
      }.setReuseItems(true);
      group.add(persons);

      CheckGroup<String> checks = new CheckGroup<>("numbersCheckGroup");
      add(checks);
      ListView<String> checksList = new ListView<String>("numbers", NUMBERS)
      {
        @Override
        protected void populateItem(ListItem<String> item)
        {
          Check<String> check = new Check<>("check", item.getModel());
          check.setLabel(item.getModel());
          item.add(check);
          item.add(new SimpleFormComponentLabel("number", check));
        }
      }.setReuseItems(true);
      checks.add(checksList);

      add(new ListMultipleChoice<>("siteSelection", SITES));
View Full Code Here


    fc = new RequiredTextField<String>("name");
    fc.add(new StringValidator(4, null));
    fc.setLabel(new ResourceModel("label.name"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("name-label", fc));

    fc = new RequiredTextField<String>("email");
    fc.add(EmailAddressValidator.getInstance());
    fc.setLabel(new ResourceModel("label.email"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("email-label", fc));

    // attach an ajax validation behavior to all form component's keydown
    // event and throttle it down to once per second

    AjaxFormValidatingBehavior.addToAllFormComponents(form, "keydown", Duration.ONE_SECOND);
View Full Code Here

        protected void populateItem(ListItem<String> item)
        {
          Radio<String> radio = new Radio<String>("radio", item.getModel());
          radio.setLabel(item.getModel());
          item.add(radio);
          item.add(new SimpleFormComponentLabel("number", radio));
        }
      }.setReuseItems(true);
      group.add(persons);

      CheckGroup<String> checks = new CheckGroup<String>("numbersCheckGroup");
      add(checks);
      ListView<String> checksList = new ListView<String>("numbers", NUMBERS)
      {
        @Override
        protected void populateItem(ListItem<String> item)
        {
          Check<String> check = new Check<String>("check", item.getModel());
          check.setLabel(item.getModel());
          item.add(check);
          item.add(new SimpleFormComponentLabel("number", check));
        }
      }.setReuseItems(true);
      checks.add(checksList);

      add(new ListMultipleChoice<String>("siteSelection", SITES));
View Full Code Here

        protected void populateItem(ListItem<String> item)
        {
          Radio<String> radio = new Radio<String>("radio", item.getModel());
          radio.setLabel(item.getModel());
          item.add(radio);
          item.add(new SimpleFormComponentLabel("number", radio));
        }
      }.setReuseItems(true);
      group.add(persons);

      CheckGroup<String> checks = new CheckGroup<String>("numbersCheckGroup");
      add(checks);
      ListView<String> checksList = new ListView<String>("numbers", NUMBERS)
      {
        @Override
        protected void populateItem(ListItem<String> item)
        {
          Check<String> check = new Check<String>("check", item.getModel());
          check.setLabel(item.getModel());
          item.add(check);
          item.add(new SimpleFormComponentLabel("number", check));
        }
      }.setReuseItems(true);
      checks.add(checksList);

      add(new ListMultipleChoice<String>("siteSelection", SITES));
View Full Code Here

    fc = new RequiredTextField<String>("name");
    fc.add(StringValidator.minimumLength(4));
    fc.setLabel(new ResourceModel("label.name"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("name-label", fc));

    fc = new RequiredTextField<String>("email");
    fc.add(EmailAddressValidator.getInstance());
    fc.setLabel(new ResourceModel("label.email"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("email-label", fc));

    // attach an ajax validation behavior to all form component's onkeydown
    // event and throttle it down to once per second

    AjaxFormValidatingBehavior.addToAllFormComponents(form, "onkeyup", Duration.ONE_SECOND);
View Full Code Here

    fc = new RequiredTextField<String>("name");
    fc.add(StringValidator.minimumLength(4));
    fc.setLabel(new ResourceModel("label.name"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("name-label", fc));

    fc = new RequiredTextField<String>("email");
    fc.add(EmailAddressValidator.getInstance());
    fc.setLabel(new ResourceModel("label.email"));

    form.add(fc);
    form.add(new SimpleFormComponentLabel("email-label", fc));

    // attach an ajax validation behavior to all form component's onkeydown
    // event and throttle it down to once per second

    AjaxFormValidatingBehavior.addToAllFormComponents(form, "onkeyup", Duration.ONE_SECOND);
View Full Code Here

        checkBox.setOutputMarkupId(true);
        add(checkBox);
    }

    private void initSimpleLabel() {
        SimpleFormComponentLabel simpleLabel = new SimpleFormComponentLabel("label", checkBox);
        simpleLabel.add(AttributeModifier.replace("for", checkBox.getMarkupId()));
        add(simpleLabel);
    }
View Full Code Here

        tester.assertComponent("panel:label", SimpleFormComponentLabel.class);
    }

    @Test
    public void testLabel_shouldShowLabelModelObject() throws Exception {
        SimpleFormComponentLabel label = (SimpleFormComponentLabel)
            tester.getComponentFromLastRenderedPage("panel:label");
        assertThat(label.getDefaultModelObjectAsString(), is("testlabel"));
    }
View Full Code Here

        if (validator != null) {
            mainComponent.add(validator);
        }
        mainComponent.setRequired(attribute.isRequired());
        mainComponent.setLabel(new LocalizableStringModel(this, attribute.getName()));
        SimpleFormComponentLabel label = new SimpleFormComponentLabel("name", mainComponent);
        label.add(AttributeModifier.replace("for", attribute.getId()));
        if (attribute.isRequired()) {
            label.add(AttributeModifier.replace("class", "required"));
        }
        add(label);
        add(mainComponent);
        addTooltip(attribute);
    }
View Full Code Here

      TextField<String> field = new TextField<String>("openid", _openIdModel = new Model<String>());
      field.setRequired(true);
      field.setLabel(new ResourceModel("openId", "Open ID"));
      field.add(new UrlValidator(new String[] { "http", "https" }));

      add(new SimpleFormComponentLabel("label", field));

      add(field);

    }
View Full Code Here

TOP

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

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.