reiern70 opened a new pull request, #1634: URL: https://github.com/apache/wicket/pull/1634
Closes #1631 Adds two behaviors in a new package `org.apache.wicket.extensions.ajax.veil` (wicket-extensions) that stop the user from interacting with the page, or with one component, while an Ajax request is running. - **`PageVeilBehavior`**: added to a page, it veils the whole page during every Ajax request fired from it. - **`LocalVeilBehavior`**: added to any component, it veils only that component, during requests fired from it or from a component nested in it. Local veils nest, and the innermost one takes the request. The veil goes up on `/ajax/call/beforeSend` and comes down on `/ajax/call/done`. It is transparent at first and swallows clicks. After 300 ms it dims the region and shows a CSS spinner, which then stays for at least 500 ms. Both timings are settable per behavior. A request opts out with `PageVeilBehavior.noVeil(attributes)`. For a component updated by a WebSocket push, the server raises the veil with `LocalVeilBehavior.getVeilMessage()` and lowers it with `unveil(handler)` or `getUnveilMessage()`. wicket-extensions does not depend on the WebSocket module. `wicket-veil.js` works with both the jQuery-based and the plain JavaScript Ajax engine. Nothing changes in wicket-core. ### Migration New API only, nothing changed or removed, so no migration is needed. An application that does not add one of the behaviors sees no difference. ### Also included - Examples: `ajax/veil` (page veil, opting out, nested local veils with their own timings) and `websockets/veil` (a background task that veils a counter panel and pushes its updates). - A user guide section in the Ajax chapter, covering the WebSocket case. - Tests: `VeilBehaviorTest`, QUnit tests for `Wicket.Veil` against both engines, and `VeilPageSeleniumTest` driving `ajax/veil` in headless Chrome. The Selenium tests need Chrome and run only with `-Dwicket.selenium=true`, as described in `JAVASCRIPTTESTING.md`. -- 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]
