Here is my jQuery one that is added to a form

@MixinAfter
@Import( library={"submitonce.js"})
public class SubmitOnce {
        
        @Inject
        private Logger logger;
        
        @Inject
        private JavaScriptSupport javaScriptSupport;
        
        @InjectContainer
        private ClientElement clientElement;
        
        private String id;
        
        void beginRender() {
                id = clientElement.getClientId();
        }
        
        void afterRender(MarkupWriter writer) {

                JSONObject params = new JSONObject();
                params.put("id",id);
                javaScriptSupport.addInitializerCall("submitonce", params);
        }

}

(function( $ ) {
        $.extend(Tapestry.Initializer, {
                
                
                submitonce: function(specs) {            
                        $('#'+specs.id + ' :submit').removeAttr('disabled');
                        
                        
$('#'+specs.id).bind('tapestry:formprepareforsubmit',function() {
                                        $('#'+specs.id + ' 
:submit').attr('disabled', 'disabled');
                                });
        
                }
        });
}) ( jQuery );

You need to look for the formprepareforsubmit event.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Confirm-mixin-with-form-validation-errors-tp5716265p5716266.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to