[ 
https://issues.apache.org/jira/browse/WICKET-4207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146798#comment-13146798
 ] 

Matthias Keller commented on WICKET-4207:
-----------------------------------------

Well this is no API change, the method signature doesn't have to change at all:
public IFormSubmittingComponent getDefaultButton(final IWizardModel model) {}
Stays as-is.
Only the imlementation does the following:
...
return (Button)get("next")
...
This cast is unnecessarily narrow as the method signature only dictates 
returning an IFormSubmittingComponent. So the cast should be to 
IFormSubmittingComponent instead.
This doesn't change any existing behavior (since Button implements that 
interface anyway) but allows subclasses to reuse this method but use 
SubmitLinks (or alike) instead.

So no API has to be amended and no existing applications have to be modified.
                
> Use the correct cast in WizardButtonBar
> ---------------------------------------
>
>                 Key: WICKET-4207
>                 URL: https://issues.apache.org/jira/browse/WICKET-4207
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.2
>            Reporter: Matthias Keller
>             Fix For: 1.6.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> WizardButtonBar.getDefaultButton() uses a cast to Button before returning the 
> found component.
> However, the interface only expects a IFormSubmittingComponent being returned.
> This makes it hard to subclass this button bar to add our own logic using 
> SubmitLinks instead of Buttons. Those casts should be changed to 
> IFormSubmittingComponent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to