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

Examples of org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink


    form.add(new TextField<String>("textfield2", new PropertyModel<String>(this,
      "textfieldForm2")));
    form.add(new Label("lbltextfield2", new PropertyModel<String>(this, "textfieldForm2")));

    form.add(new AjaxSubmitLink("submit")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        info("onSubmit");
        hitOnSubmit = true;
        target.addComponent(form);
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
        error("onError");
        hitOnError = true;
        target.addComponent(form);
      }
    });

    // --------------------

    MyBorder border = new MyBorder("border");
    add(border);

    border.addToBorderBody(new TextField<String>("textfield1", new PropertyModel<String>(this,
      "textfield1")).setRequired(true));
    border.addToBorderBody(new Label("lbltextfield1", new PropertyModel<String>(this,
      "textfield1")));

    border.addToBorderBody(new TextField<String>("textfield2", new PropertyModel<String>(this,
      "textfield2")));
    border.addToBorderBody(new Label("lbltextfield2", new PropertyModel<String>(this,
      "textfield2")));

    // --------------------

    Form<Void> form3 = new Form<Void>("form3");
    MyPanel panel = new MyPanel("panel");
    form3.add(panel);
    form3.add(new AjaxSubmitLink("submit")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form form)
View Full Code Here


    form.setOutputMarkupId(true);
    addToBorder(form);

    form.add(new FeedbackPanel("feedback"));

    form.add(new AjaxSubmitLink("submit")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
View Full Code Here

      TextField<String> secondField = new TextField<String>("second");
      add(firstField);
      add(secondField);

      add(new EqualInputValidator(firstField, secondField));
      add(new AjaxSubmitLink("ajaxSubmit", this)
      {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form)
View Full Code Here

    });

    // AjaxSubmitLink
    final Form form = new Form("form");
    add(form);
    final AjaxSubmitLink submit = new AjaxSubmitLink("submit")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(final AjaxRequestTarget target, final Form<?> form)
View Full Code Here

    form.add(checkGroup);

    checkGroup.add(new Check<Integer>("check1", new Model<Integer>(1)));
    checkGroup.add(new Check<Integer>("check2", new Model<Integer>(2)));

    add(new AjaxSubmitLink("submitLink", form)
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
View Full Code Here

  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink("link")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
View Full Code Here

  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
View Full Code Here

      {
        fail("Link " + path + " is an AjaxSubmitLink and " +
          "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;
      submitAjaxFormSubmitBehavior(link,
        (AjaxFormSubmitBehavior)WicketTesterHelper.findAjaxEventBehavior(link, "onclick"));
    }
    /*
     * If the link is a submitlink then we pretend to have clicked it
View Full Code Here

      {
        fail("Link " + path + " is an AjaxSubmitLink and " +
          "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      String pageRelativePath = link.getInputName();
      request.getPostParameters().setParameterValue(pageRelativePath, "x");

      submitAjaxFormSubmitBehavior(link,
        (AjaxFormSubmitBehavior)WicketTesterHelper.findAjaxEventBehavior(link, "onclick"));
    }
View Full Code Here

    Form<Void> form = new Form<Void>("form");
    form.add(new TextField<String>("name", new PropertyModel<String>(this, "name")));

    add(form);

    add(new AjaxSubmitLink("helloSubmit", form)
    {

      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        text = "Hello " + name;
        target.addComponent(label);
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
        throw new RuntimeException("Unexpected error occurred.");
      }
    });

    add(new AjaxSubmitLink("goodbyeSubmit", form)
    {

      private static final long serialVersionUID = 1L;

      @Override
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink

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.