Examples of AjaxSubmitLink


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

      };
      password.add(new SimpleAttributeModifier("maxlength", "32"));
      password.setRequired(mUser.getObject().isTransient());
      add(password);
     
      add(new AjaxSubmitLink("save") {
        private static final long serialVersionUID = 1L;

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

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

            target.addComponent(editPeriodForm)
          }
        }
      });
     
      add(new AjaxSubmitLink("save") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          editPeriodForm.setVisible(false);
View Full Code Here

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

      };
      add(classMessageForm);
      classMessageForm.setOutputMarkupPlaceholderTag(true);
      classMessageForm.setVisible(false);
      classMessageForm.add(new TextArea<String>("message").add(new MaximumLengthValidator(255)).setRequired(true));
      classMessageForm.add(new AjaxSubmitLink("save") {
        private static final long serialVersionUID = 1L;
       
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          staticContent.setVisible(true);
View Full Code Here

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

        public void onClick(AjaxRequestTarget target) {
          target.appendJavascript("$('#" + addPeriodPanelMarkupId + "').hide();");
        }
      });
     
      add(new AjaxSubmitLink("save") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          if (target != null) {
View Full Code Here

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

    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;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        messageList.add(0, (FeedbackMessage) form.getModelObject());
View Full Code Here

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

            target.addComponent(editQuestionTitleForm)
          }       
        }
      });

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

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          questionTitleContainer.setVisible(true);
View Full Code Here

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

    Form<Void> toolbarForm = new Form<Void>("toolbarForm");
    add(toolbarForm);
   
    toolbarForm.add(selectedText = new HiddenField<String>("selectedText", new Model<String>("")));

    AjaxSubmitLink dictionary = new AjaxSubmitLink("dictionary") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        String word = selectedText.getModelObject();
        List<Definition> defs = getDefinition(word);
        mDefinition.setObject(formatDefinition(word, defs));
        if (defs!=null && !defs.isEmpty()) {
          String canonicalWord = defs.get(0).getWord();
          link.setDefaultModelObject(WORDNIK_BASE_URL+canonicalWord);
          link.setVisibilityAllowed(true);
        } else {
          link.setVisibilityAllowed(false);
        }
        target.addComponent(definition);
        target.addComponent(link);
      }

      @Override
      protected IAjaxCallDecorator getAjaxCallDecorator() {
        return new AjaxCallDecorator() {
          private static final long serialVersionUID = 1L;

          // Several jobs for the Javascript:
          // 1. Get the text selection and put it into a form field for transmission to server
          // 2. Remove old definition that may be in modal window, replace with "Please wait"
          // 3. Open modal
          // 4. Do normal script, which means AJAX-submitting form to server.
          // FIXME: Please wait should be a string property
          // FIXME: does not properly get text selection from inside IFrame (e.g. TinyMCE)
          @Override
          public CharSequence decorateScript(final CharSequence script) {
            return "$('#selectedText').val(getSelectedText());"
              + "$('#" + dictionaryModal.getMarkupId() + " .definitionContainer').text('Please wait...');"
              + dictionaryModal.getOpenString()
              + script
              ;
          }
        };
      }
     
    };
    dictionary.setMarkupId("thtDictionary"); // id expected by CSS
    toolbarForm.add (dictionary);
  }
View Full Code Here

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

      mResponse = responseService.newSingleSelectResponse(mTargetUser, getModel());
       
    RadioGroup<String> radioGroup = new RadioGroup<String>("radioGroup", new Model<String>(mResponse.getObject().getText()));
    add(radioGroup);

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

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        if (target != null) {
          refreshListeners(target);
        }
      }

      @Override
      public boolean isVisible() {
        return isEnabledInHierarchy();
      }
    };
    link.setOutputMarkupId(true);
    radioGroup.add(link);

    // Message displayed if no multiple choice item has been chosen
    radioGroup.add(new Label("selectNone", new ResourceModel("isi.noMultChoiceSelected", "Make a selection")).setVisible(false));
  }
View Full Code Here

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

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

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      // We cycle through the attached behaviors and select the
      // LAST matching behavior as the one we handle.
      List<IBehavior> behaviors = link.getBehaviors();
      AjaxFormSubmitBehavior ajaxFormSubmitBehavior = null;
      for (IBehavior behavior : behaviors)
      {
        if (behavior instanceof AjaxFormSubmitBehavior)
        {
View Full Code Here

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

      {
        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
TOP
Copyright © 2018 www.massapi.com. 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.