1. #1
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    38
    Vote Rating
    1
    rijkvanwel is on a distinguished road

      0  

    Question Unanswered: Form submit success/failure callback invocation

    Unanswered: Form submit success/failure callback invocation


    The manual states that in order to trigger a call of your success handler function, you need to package your response in a JSON object that has a 'success:true' property. This is different from the way Ext 3 handles it, which is a lot more elegant in my opinion. Ext 3 automatically calls the failure handler upon receiving an HTTP-500 response from the server, and the success handler otherwise. This worked very well for me, as I threw Exceptions in PHP and converted those to JSON objects with a HTTP-500 header.

    Is there a specific reason this behavior was changed? Or am I overlooking something?
    Regards,
    Rijk van Wel

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So if you have status code 200 and JSON of { "success" : true, ... } it will fire the success handler. If you have a code 200 and { "success" : false } it will fire the failure handler. If you have a code like 400 and { "success" : true } it will fire the success handler?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    38
    Vote Rating
    1
    rijkvanwel is on a distinguished road

      0  

    Default


    My point is more that no handler is being fired when there is no 'success' key in the response. So I'm tied to this response format of an object with a success property. Which I think is redundant, because we can infer that from the HTTP response code (like happened in Ext 3). This allows for smaller and more elegant responses and more efficient use of the HTTP protocol (the object-with-success-property adds a lot of overhead if say you just want to return an ID).
    Regards,
    Rijk van Wel

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi