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

Tsutomu YANO edited comment on WICKET-2688 at 3/3/10 4:17 AM:
--------------------------------------------------------------

I tested with wicket 1.4.7.

- sample project, which I uploaded on this page, works correctly with wicket 
1.4.7
- my project, on which I found this issue, DID NOT work correctly with wicket 
1.4.7. When I posted same file twice on versioned form, the page expired. I 
don't find out the reason yet.
  When the form is not versioned, the page works correctly.



      was (Author: t_yano):
    I tested with wicket 1.4.7.

- sample project, which I uploaded on this page, works correctly with wicket 
1.4.7
- my project, on which I found this issue, DID NOT work correctly with wicket 
1.4.7. When I posted same file twice on versioned form, the page expired. I 
don't find out the reason yet.


  
> Versioned form with FileUploadField will expire page if you submit the form 
> twice.
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2688
>                 URL: https://issues.apache.org/jira/browse/WICKET-2688
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Tsutomu YANO
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: WICKET-2688.patch, wicket-bugtest.zip
>
>
> If a form has FileUploadField and versioned, Page, on which the form is, will 
> be expired at second post of the form.
> run a attached project file. In this sample program, onSubmit() method of 
> Form always displays same page with an error message. Post the form again, 
> then page will be expired.
> This problem will occur if a versioned property of FileUploadField is true. 
> If the property is false, this problem never occurs.
> If you use setVersioned() method of Form with FileUploadField, the 
> 'versioned' property of the FileUploadField becomes true automatically, so 
> this problem easily occurs in the timing not anticipated.
> I noticed version number of page up twice on 'detach' time, if 
> FileUploadField is versioned.
> I expect, this problem might occur only for components with isMultiPart() == 
> true, although I could not found the evidence. 
> If so, 'versioned' property of such component must never become true. In 
> addition, setVersioned() method of Form component should check children are 
> Multipart or not, like below.
> @Override
> public final Component setVersioned(final boolean isVersioned)
> {
>       super.setVersioned(isVersioned);
>       // Search for FormComponents like TextField etc.
>       visitFormComponents(new FormComponent.AbstractVisitor()
>       {
>               @Override
>               public void onFormComponent(final FormComponent<?> 
> formComponent)
>               {
>                   if(!formComponent.isMultiPart()) {  //set true only if the 
> child is not multipart component.
>                           formComponent.setVersioned(isVersioned);
>                       }
>               }
>       });
>       return this;
> }

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

Reply via email to