2012-01-29, Michael Gerzabek: > The form tag automagically renders a javascript handler for the onSubmit > event [1, line 388]. It uses the same snippet that's declared for > onclick handler in MarkupConstants.WAIT_FOR_PAGE > <http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/MarkupConstants.html> > [2] described in [3]. > > How could I contribute my own javascript snippet to onSubmit attribute > of forms? How can I override this setting?
The problem is that this is no setting and therefore cannot be overwritten. One solution is to override the default JavaScriptStack of Tapestry and provide another implementation of the onSubmit handler: 1. copy CoreJavaScriptStack 2. change tapestry.js in array to a modified copy in your project 3. contribute the overridden configuration public static void contributeJavaScriptStackSource(MappedConfiguration<String, JavaScriptStack> configuration) { configuration.overrideInstance(InternalConstants.CORE_STACK_NAME, MyCoreJavaScriptStack.class); } Has anybody a better idea? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org