Hi Rich,

You could use Javascript to submit the form using AJAX and then in the load 
section popup your dialog.

function sendXHRAndUpdate(settings){
        var xhrArgs = {
                form : settings.formId,
                handleAs : "json",
                load : function(data) {
                        
                        {Pop up your popup here}

                },
                error : function(error) {
                        
                }
        }

        var deferred = dojo.xhrPost(xhrArgs);
} 

I use dojo but you could use plain javascript or the Tapestry methods. You can 
even return a JSONObject from the onSubmitHandler with messages etc.. for your 
popup.

Hope this helps.

Dave


On 30 Mar 2011, at 23:13, Rich M wrote:

> Hi,
> 
> I'm wondering if there is a good strategy to create a popup window after a 
> successful form submit. The concept here is to popup a Voucher/Coupon window 
> for the user if they complete a successful purchase.
> 
> I've researched the basics of the concept in terms of HTML forms. You can run 
> some Javascript to open a new window on submission of an HTML form. I'd like 
> to be able to limit this functionality to only occur if the transaction is 
> successful, in other words after the onSuccess method has run. Is there any 
> means to fire javascript at this stage before a page refresh, or should I be 
> looking rather at persisted fields and conditionally executing the javascript 
> on page rending after the onSuccess method invokes a re-render of the page?
> 
> Looking at the Event constants in the tapestry.js, I didn't immediately see 
> an event beyond prepare/validate for forms that I might observe.
> 
> Thanks,
> Rich
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to