On 02/25/2011 06:17 PM, Josh Canfield wrote:
I grabbed your code and ran it. I'm not 100% sure what's supposed to
happen if you perform an ajax post but don't return anything, but have
errors.
Me neither, I suppose I expected that simply using the recordError would have my page functioning the same way the POST would without AJAX, but that's a bit naive
I added a handler for failure and returned the same block back
and it seems to do the right thing. Is the form supposed to just send
back the errors if it fails?

     Block onFailure() {
         log.debug("Failed form post");
         return resources.findBlock("triggerPrice");
     }


Yes, the form is supposed to send back just errors if it fails. I think using onFailure is my best solution at this point, I didn't realize I could catch onFailure and return a Block/Page/etc, I think I had become reliant on using onValidate and recordError to do as much for me in the rest of the pages I wrote.

I tried the onFailure returning the findBlock("triggerPrice") from ComponentResources as well as using blockZone.getBody(). In both of those cases, the page re-rendered with the Tapestry red X beside the form input field in error, but the Validation Bubbles did not appear.

I've decided to save myself some trouble and use onFailure to return the page by String name so the full reload occurs and the Validation Bubbles show.

Thanks for the help,
Rich

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to