[
https://issues.apache.org/jira/browse/WICKET-5495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13887552#comment-13887552
]
Sven Meier commented on WICKET-5495:
------------------------------------
Why don't you use Button#setDefaultFormProcessing(false) for this?
> 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)