You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Petr Sakar (JIRA)" <ji...@apache.org> on 2008/03/23 08:17:24 UTC

[jira] Commented: (WICKET-1414) findSubmittingButton will fail when button without form is added before form

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

Petr Sakar commented on WICKET-1414:
------------------------------------

Igor,
you are totally right in your statements. I'm do not want to use button without the form normally, I've used it only by mistake. It lead to this strange behavior, so I was just carious why it is working in one case and in second not.

My point is if I use this button without the form in front of valid form, the valid form is not working, if it's after, it is working. The reason is you are searching for submitting component in whole page.

one) If  button outside the form is not supported, would be nice to issue some warning or exception

two) i do not know if submittingButton in form can be outside of form on not. In case that not, it does not make sense to search for it in whole page, should be searched only in form. In case you have page with lot of components it can bring significant speed improvement.

Do you have any example, where the submitting button is outside the form (by your first statement it should not exist) ? If it can not be outside the form, should not be any problem to search only in form scope instead of page scope.


> findSubmittingButton will fail when button without form is added before form
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-1414
>                 URL: https://issues.apache.org/jira/browse/WICKET-1414
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Petr Sakar
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.3
>
>         Attachments: myproject.zip
>
>
> Form submitting button is not found when page contains another button, which is not part of form and is added to the page hierarchy before form. When it is added after the form, it is working. The problem is in the method of Form class:
> 	public final IFormSubmittingComponent findSubmittingButton()
> 	{
> 		IFormSubmittingComponent submittingComponent = (IFormSubmittingComponent) getPage().visitChildren(
> 			IFormSubmittingComponent.class, new IVisitor()
> which is serching for the submitting button in the whole page instead of the form only. I think correctly should be
> 	public final IFormSubmittingComponent findSubmittingButton()
> 	{
> 		IFormSubmittingComponent submittingComponent = (IFormSubmittingComponent)visitChildren(
> 			IFormSubmittingComponent.class, new IVisitor()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.