You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John <jo...@quivinco.com> on 2013/08/26 23:11:16 UTC

ajax form onSuccess not called

why is onSuccess not invoked but onValidate is?

    void onValidateFromBookingform() {
        log.debug("validate booking");
    }
        
    Object onSuccessFromBookingform() {
        log.debug("submit booking");
        booking = false;
        if (request.isXHR()) {
            return bookingZone;
        }
        return null;
    }

Re: ajax form onSuccess not called

Posted by John <jo...@quivinco.com>.
Hi,

Yes there were errors, they were hidden by the jquery accordian I used for the form and caused by using default true along with validate, even though the fields were not invalid.

John
  ----- Original Message ----- 
  From: Geoff Callender 
  To: Tapestry users 
  Sent: Tuesday, August 27, 2013 4:48 AM
  Subject: Re: ajax form onSuccess not called


  In onSuccess, see whether bookingform.getHasErrors() returns true. To dig
  in further, try bookingform.getDefaultTracker().getErrors().


  On 27 August 2013 07:26, John <jo...@quivinco.com> wrote:

  > I think I found a partial answer to this, some of the input fields (ones
  > marked disabled="true") are showing as invalid on the page?
  >
  > John
  >   ----- Original Message -----
  >   From: John
  >   To: users@tapestry.apache.org
  >   Sent: Monday, August 26, 2013 10:11 PM
  >   Subject: ajax form onSuccess not called
  >
  >
  >   why is onSuccess not invoked but onValidate is?
  >
  >       void onValidateFromBookingform() {
  >           log.debug("validate booking");
  >       }
  >
  >       Object onSuccessFromBookingform() {
  >           log.debug("submit booking");
  >           booking = false;
  >           if (request.isXHR()) {
  >               return bookingZone;
  >           }
  >           return null;
  >       }
  >

Re: ajax form onSuccess not called

Posted by Geoff Callender <ge...@gmail.com>.
In onSuccess, see whether bookingform.getHasErrors() returns true. To dig
in further, try bookingform.getDefaultTracker().getErrors().


On 27 August 2013 07:26, John <jo...@quivinco.com> wrote:

> I think I found a partial answer to this, some of the input fields (ones
> marked disabled="true") are showing as invalid on the page?
>
> John
>   ----- Original Message -----
>   From: John
>   To: users@tapestry.apache.org
>   Sent: Monday, August 26, 2013 10:11 PM
>   Subject: ajax form onSuccess not called
>
>
>   why is onSuccess not invoked but onValidate is?
>
>       void onValidateFromBookingform() {
>           log.debug("validate booking");
>       }
>
>       Object onSuccessFromBookingform() {
>           log.debug("submit booking");
>           booking = false;
>           if (request.isXHR()) {
>               return bookingZone;
>           }
>           return null;
>       }
>

Re: ajax form onSuccess not called

Posted by John <jo...@quivinco.com>.
I think I found a partial answer to this, some of the input fields (ones marked disabled="true") are showing as invalid on the page?

John
  ----- Original Message ----- 
  From: John 
  To: users@tapestry.apache.org 
  Sent: Monday, August 26, 2013 10:11 PM
  Subject: ajax form onSuccess not called


  why is onSuccess not invoked but onValidate is?

      void onValidateFromBookingform() {
          log.debug("validate booking");
      }
          
      Object onSuccessFromBookingform() {
          log.debug("submit booking");
          booking = false;
          if (request.isXHR()) {
              return bookingZone;
          }
          return null;
      }