reiern70 opened a new pull request, #1652: URL: https://github.com/apache/wicket/pull/1652
Take II of #1651, for #1650. It holds the commits of #1651 (mine and Emond's) and one more, fixing the two things from my review there: - **A control named `submit`**: `Form#getJsForListenerUrl()` submitted with `f.submit()`. A form control's name shadows the form's property, and a Wicket control's name is its component path, so a button or field with the id `submit` directly in the form made `f.submit` that element: `TypeError: f.submit is not a function`, the form was not submitted (either engine). It now calls `HTMLFormElement.prototype.submit.call(f)`. - **`stopPropagation()` before the form**: a capturing handler on an ancestor (document, body) stopping the propagation without cancelling kept the event from reaching the form, so it was never cancelled and Firefox submitted the form besides the Ajax request. `stopPropagation()` is now wrapped like `stopImmediatePropagation()`. Caveat: a handler on that same element running afterwards can no longer stop the Ajax request by cancelling. Tests: - QUnit `Wicket.Event.triggerSubmit`: a capturing handler stopping the propagation (Ajax goes on, event cancelled, no submission), one cancelling and stopping (Ajax stopped), and a form with a control named `submit` being submitted. Run in Chrome and Firefox with both engines; `mvn verify -Pjs-test -pl testing/wicket-js-tests` green (154/153). - `FormTest` updated to the new script; `FormTest`, `AjaxFormSubmitBehaviorTest`, `AjaxButtonTest` green. Master only, like #1651: Wicket 10.x triggers the event through jQuery and cancels it in its own handler, and its `getJsForListenerUrl()` fires the event through jQuery, which only calls the native `submit()` when it is a function. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
