Package org.apache.wicket.ajax.attributes

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener


  @Override
  protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
  {
    super.updateAjaxAttributes(attributes);

    AjaxCallListener ajaxCallListener = new AjaxCallListener();
    StringBuilder js = new StringBuilder();
    CharSequence sel = getBlockElementsSelector();
    if (sel != null)
    {
      js.append("$('").append(sel).append("').block( ");
    }
    else
    {
      js.append("$.blockUI( ");
    }
    js.append(options.toString()).append(" ); ");

    ajaxCallListener.onBefore(js);
  }
View Full Code Here


   *
   * @param attributes
   */
  private void updateAjaxAttributesBackwardCompatibility(final AjaxRequestAttributes attributes)
  {
    AjaxCallListener backwardCompatibleAjaxCallListener = new AjaxCallListener();
    backwardCompatibleAjaxCallListener.onSuccess(getSuccessScript());
    backwardCompatibleAjaxCallListener.onFailure(getFailureScript());
    backwardCompatibleAjaxCallListener.onPrecondition(getPreconditionScript());
    attributes.getAjaxCallListeners().add(backwardCompatibleAjaxCallListener);

    AjaxChannel channel = getChannel();
    if (channel != null)
    {
View Full Code Here

            @Override
            protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
            {
              super.updateAjaxAttributes(attributes);
              AjaxCallListener ajaxCallListener = new AjaxCallListener()
              {
                @Override
                public CharSequence getFailureHandler(Component component)
                {
                  return "window.location=this.href;";
View Full Code Here

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
      {
        super.updateAjaxAttributes(attributes);
        IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
          @Override
          public CharSequence getBeforeHandler(Component component)
          {
            return "showLoadingIndicator();";
          }
View Full Code Here

        CharSequence precondition = "var kc=Wicket.Event.keyCode(attrs.event),"
          + "evtType=attrs.event.type,"
          + "ret=false;"
          + "if(evtType==='blur' || (evtType==='keyup' && (kc===27 || kc===13))) ret = true;"
          + "return ret;";
        AjaxCallListener ajaxCallListener = new AjaxCallListener();
        ajaxCallListener.onPrecondition(precondition);
        attributes.getAjaxCallListeners().add(ajaxCallListener);

      }
    });
    return editor;
View Full Code Here

            "var kc=Wicket.Event.keyCode(attrs.event),"+
                "evtType=attrs.event.type,"+
                "ret=false;"+
                "if(evtType==='blur' || (evtType==='keyup' && (kc===27))) ret = true;"+
                "return ret;";
        AjaxCallListener ajaxCallListener = new AjaxCallListener();
        ajaxCallListener.onPrecondition(precondition);
        attributes.getAjaxCallListeners().add(ajaxCallListener);
      }
    });
    return editor;
  }
View Full Code Here

  @Test
  public void renderAjaxAttributes()
  {
    AjaxRequestAttributes attributes = new AjaxRequestAttributes();

    AjaxCallListener listener = new AjaxCallListener();
    listener.onPrecondition("return somePrecondition();");
    listener.onBefore("alert('Before!');");
    listener.onAfter("alert('After!');");
    listener.onSuccess("alert('Success!');");
    listener.onFailure("alert('Failure!');");
    listener.onComplete("alert('Complete!');");
    attributes.getAjaxCallListeners().add(listener);

    Component component = Mockito.mock(Component.class);
    AbstractDefaultAjaxBehavior behavior = new AbstractDefaultAjaxBehavior()
    {
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.attributes.AjaxCallListener

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.