Package org.apache.wicket.ajax.calldecorator

Examples of org.apache.wicket.ajax.calldecorator.AjaxCallDecorator


        onEvent(target, date);
      }

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

          public CharSequence decorateScript(CharSequence script)
          {
View Full Code Here


      }

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

                    @Override
          public CharSequence decorateScript(CharSequence script)
View Full Code Here

   *
   * @param dialog existing dialog to be closed before loading is displayed.
   * @return
   */
  public IAjaxCallDecorator getLoadingDialogDecorator(final AbstractISIAjaxDialog<?> dialog) {
    return new AjaxCallDecorator() {

      private static final long serialVersionUID = 1L;
      @Override
      public CharSequence decorateScript(CharSequence script) {
        return (dialog == null ? "" : dialog.getDialogBorder().getCloseString(false)) + loadingDialog.getOpenString(dialog == null) + script;
View Full Code Here

        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"
View Full Code Here

      }

      @Override
      protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          @Override
          public CharSequence decorateOnSuccessScript(Component c, CharSequence script)
          {
            return "alert('Success');";
          }

          @Override
          public CharSequence decorateOnFailureScript(Component c, CharSequence script)
          {
            return "alert('Failure');";
          }

          @Override
          public CharSequence decorateScript(Component c, CharSequence script)
          {
            return "alert('Before ajax call');" + script;
          }
        };
      };
    });

    add(new AjaxLink<Void>("failure-link")
    {
      @Override
      public void onClick(AjaxRequestTarget target)
      {
        throw new WicketRuntimeException("Failure link clicked");
      }

      @Override
      protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          @Override
          public CharSequence decorateOnSuccessScript(Component c, CharSequence script)
          {
            return "alert('Success');";
View Full Code Here

    commentForm.add(new AjaxFormSubmitBehavior(commentForm, "onsubmit")
    {
      @Override
      protected IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          @Override
          public CharSequence decorateScript(Component c, CharSequence script)
          {
            return script + "return false;";
View Full Code Here

            @Override
            protected IAjaxCallDecorator getAjaxCallDecorator() {
                // we need to force EditArea to update the textarea contents (which it hides)
                // before submitting the form, otherwise the contents won't be the ones the user
                // edited
                return new AjaxCallDecorator() {
                    @Override
                    public CharSequence decorateScript(CharSequence script) {
                        return "document.getElementById('requestBody').value = editAreaLoader.getValue('requestBody');"
                                + script;
                    }
View Full Code Here

           
            @Override
            protected IAjaxCallDecorator getAjaxCallDecorator() {
                // we need to force EditArea to update the textarea contents (which it hid)
                // before submitting the form, otherwise the validation will go bye bye
                return new AjaxCallDecorator() {
                    @Override
                    public CharSequence decorateScript(CharSequence script) {
                        return "document.getElementById('editor').value = editAreaLoader.getValue('editor');" + script;
                    }
                };
View Full Code Here

      {
      }

      protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          public CharSequence decorateOnSuccessScript(CharSequence script)
          {
            return "alert('Success');";
          }

          public CharSequence decorateOnFailureScript(CharSequence script)
          {
            return "alert('Failure');";
          }

          public CharSequence decorateScript(CharSequence script)
          {
            return "alert('Before ajax call');" + script;
          }
        };
      };
    });

    add(new AjaxLink("failure-link")
    {
      public void onClick(AjaxRequestTarget target)
      {
        throw new WicketRuntimeException("Failure link clicked");
      }

      protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          public CharSequence decorateOnSuccessScript(CharSequence script)
          {
            return "alert('Success');";
          }
View Full Code Here

    // specific stuff, like rendering our components.
    commentForm.add(new AjaxFormSubmitBehavior(commentForm, "onsubmit")
    {
      protected IAjaxCallDecorator getAjaxCallDecorator()
      {
        return new AjaxCallDecorator()
        {
          public CharSequence decorateScript(CharSequence script)
          {
            return script + "return false;";
          }
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.calldecorator.AjaxCallDecorator

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.