[
https://issues.apache.org/jira/browse/WICKET-5495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13888079#comment-13888079
]
Alex Grant commented on WICKET-5495:
------------------------------------
Oops. Why didn't I think of that?
That does indeed mostly solve my problem. I have some weird custom-built
components that don't behave properly with that solition, but I think that's
mainly because they're weird and custom-built.
Thank you.
But in regards to Form.findSubmittingButton(), is it supposed to only work if
you execute it during submit processing rather than during rendering? The
javadoc doesn't specify but I guess it's implied.
> Form.findSubmittingButton() throws a WicketRuntimeException if the relevant
> button is now disabled
> --------------------------------------------------------------------------------------------------
>
> Key: WICKET-5495
> URL: https://issues.apache.org/jira/browse/WICKET-5495
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 6.13.0
> Reporter: Alex Grant
>
> In Form.findSubmittingButton(), there is a test to ensure the relevant button
> is both visible and enabled.
> However, this means that is no longer possible to determine which button is
> clicked if it has become disabled.
> A simple example of this is if you are on the second step of a wizard and you
> click the Previous button. That button is now disabled so invoking this
> method throws an Exception.
> I want to be able to use this method in a wizard that also renders tabs at
> the top (to allow the user to jump between steps), because I only want the
> required field validation to fire if the user clicks Finish so all my
> mandatory fields have the isRequired() method overridden to check if the
> submitting button is the Finish button. This has the side-effect that
> Form.findSubmittingButton() is invoked when rendering the page (rather than
> just when processing the submit), by which time the button is now disabled.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)