Examples of onPrecondition()


Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

          + "evtType=attrs.event.type,"
          + "ret=false;"
          + "if (evtType==='blur' || (evtType==='keyup' && kc===27) || (evtType==='keydown' && kc===13)) {attrs.event.preventDefault(); ret = true;}"
          + "return ret;";
        AjaxCallListener ajaxCallListener = new AjaxCallListener();
        ajaxCallListener.onPrecondition(precondition);

        CharSequence dynamicExtraParameters = "var result,"
          + "evtType=attrs.event.type;"
          + "if (evtType === 'keyup') { result = { 'save': false }; }"
          + "else { result = { 'save': true }; }"
View Full Code Here

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

  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

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

  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

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

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

        AjaxCallListener listener = new AjaxCallListener();
        listener.onPrecondition(String.format("return $('#%s').parsley( 'validate' );", form.getMarkupId()));
        attributes.getAjaxCallListeners().add(listener);
      }
    };
    form.add(submit);
    }
View Full Code Here

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

    // For the 'complete' handler it looks like: function(attrs, jqXHR, textStatus){Wicket.Log.info('[Wicket Ajax 6 demo]: executing a complete handler');}
    listener.onComplete("Wicket.Log.info('[Wicket Ajax 6 demo]: executing a complete handler. Status: ' + textStatus);");

    // change the return to 'false' and the Ajax call wont be executed at all.
    listener.onPrecondition("return true;");

    attributes.getAjaxCallListeners().add(listener);
  }

  /**
 
View Full Code Here

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

  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

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

            + "evtType=attrs.event.type,"
            + "ret=false;"
            + "if(evtType==='blur' || evtType==='change' || (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

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

  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

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

          + "evtType=attrs.event.type,"
          + "ret=false;"
          + "if (evtType==='blur' || (evtType==='keyup' && kc===27) || (evtType==='keydown' && kc===13)) {attrs.event.preventDefault(); ret = true;}"
          + "return ret;";
        AjaxCallListener ajaxCallListener = new AjaxCallListener();
        ajaxCallListener.onPrecondition(precondition);

        CharSequence dynamicExtraParameters = "var result = [],"
          + "evtType=attrs.event.type;"
          + "if (evtType === 'keyup') { result.push( { name: 'save', value: false } ); }"
          + "else { result = Wicket.Form.serializeElement(attrs.c); result.push( { name: 'save', value: true } ); }"
View Full Code Here

Examples of org.apache.wicket.ajax.attributes.AjaxCallListener.onPrecondition()

  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!');");
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.