On Wed, Feb 5, 2020 at 9:57 PM Emond Papegaaij
<emond.papega...@gmail.com> wrote:
> While fixing the CSP violations in the examples, I noticed a strange
> situation in SubmitLink example:
> http://examples8x.wicket.apache.org/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.SubmitLinkPage
>
> In this example, the internal submit link immediately submits the
> form, while the external submit link shows a confirmation. This
> confirmation is specified via an onsubmit on the form in the markup.
> The JS for the external link explicitly checks onsubmit and calls
> this, while the internal link does not check the onsubmit attribute. I
> think these should match, and I would like to replace the f.submit()
> call with a proper submit event trigger via Wicket.Event.fire(f,
> 'submit').
>
> Does anyone know why this discrepancy exists, or is it merely an oversight?

Doh, I can answer this myself, it's controlled via
shouldInvokeJavaScriptFormOnsubmit. Unfortunately, that does not work
with a strict CSP. What about changing this method to control the
switch between 'f.submit()' and 'Wicket.Event.fire(f, 'submit')'? The
first will not trigger any event bindings, the second will. For this,
the name of the method should be adjusted accordingly.

Best regards,
Emond

Reply via email to