You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2009/10/12 17:03:26 UTC
Re: FileUploadField blocks component submission when an empty file is
selected
is your fileuploadfield marked as required?
-igor
On Mon, Oct 12, 2009 at 6:04 AM, Ian Marshall
<ge...@gmail.com> wrote:
> I have a FileUploadField component in a form. My issue is that when a file
> of size zero is selected using the component's integral "Browse..." button,
> and then one of the owning form's submit buttons is clicked, neither that
> button's nor the form's overridden onSubmit() methods is called. The form
> becomes unsubmissible.
>
> If a non-empty file is subsequently selected using the FileUploadField
> component's "Browse..." button, then normal onSubmit() functionality is
> restored.
>
> Is this a known bug, or can I do something to prevent this behaviour for
> empty files?
>
> My NetBeans environment is:
>
> Product Version: NetBeans IDE 6.7 (Build 200906241340)
> Java: 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02
> System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
> Userdir: C:\Documents and Settings\Ian\.netbeans\6.7
>
> Wicket plug-in used:
> Wicket as a library
> Version: 1.4
> Description: Wicket 1.4 RC1 Library
>
> Wicket Support:
> Version: 0.15
>
> Wicket File Templates:
> Version: 1.1
>
>
> Regards,
>
> Ian Marshall
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file
is selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> 1.4-RC1???
>
> you know that 1.4.2 is out...
>
> -igor
>
Thank you for this prod. I was using Geertjan's Wicket 1.4 Support plug-in
for NetBeans. I have now taken the plunge and updated my plug-in
installation to 1.4.2. I have checked that this version's .jar file is used
by my built app. The issue persists; I have updated my JIRA submission
(Wicket-2523) to reflect the 1.4.2 version of Wicket.
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25922234.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file is
selected
Posted by Igor Vaynberg <ig...@gmail.com>.
1.4-RC1???
you know that 1.4.2 is out...
-igor
On Wed, Oct 14, 2009 at 3:08 AM, Ian Marshall
<ge...@gmail.com> wrote:
>
>
> igor.vaynberg wrote:
>>
>> sure, you can create a quickstart that reproduces this and attach it
>> to a jira issue.
>>
> Thanks. I have not done a quickstart. (Is this a Maven thing? I am still an
> Ant person!) I have created the JIRA issue, which can be found at
>
> https://issues.apache.org/jira/browse/WICKET-2523
>
> Please let me know if there is anything more I can do to specift the problem
> better.
>
> Ian Marshall
>
> --
> View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25888396.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file
is selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> sure, you can create a quickstart that reproduces this and attach it
> to a jira issue.
>
Thanks. I have not done a quickstart. (Is this a Maven thing? I am still an
Ant person!) I have created the JIRA issue, which can be found at
https://issues.apache.org/jira/browse/WICKET-2523
Please let me know if there is anything more I can do to specift the problem
better.
Ian Marshall
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25888396.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file is
selected
Posted by Igor Vaynberg <ig...@gmail.com>.
sure, you can create a quickstart that reproduces this and attach it
to a jira issue.
-igor
On Tue, Oct 13, 2009 at 4:44 AM, Ian Marshall
<ge...@gmail.com> wrote:
>
>
> igor.vaynberg wrote:
>>
>> weird, you will have to debug and see what is happening.
>>
>> a good place to start is Form#onFormSubmitted()
>>
>> -igor
>>
> Thanks for the tip, Igor.
>
> I have tried this, and my Form#onFormSubmitted() method is only called if
> the FileUploadField field does not have an empty file selected. However, I
> have found that my results depend on the internet browser used.
>
> Using Mozilla Firefox (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
> rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)) I get the
> blocking activity that I have already described (form submission requests by
> submit components do not result in component or form submission).
>
> Using Microsoft Internet Explorer 8 (version 8.0.6001.18702) all works fine
> and an empty file does not block processing in any way.
>
> I shall have to proceed, but I do not know whether my problem is a true bug
> of Wicket or not. I have tried file upload components from other web sites
> on Firefox and this problem does not arise.
>
> I am not a developer of the Wicket framework. Is there any way I can submit
> this behaviour as a potential bug for someone else to verify or not?
>
> Thanks again for your questions and pointers anyway.
>
> Ian Marshall
> --
> View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25871355.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file
is selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> weird, you will have to debug and see what is happening.
>
> a good place to start is Form#onFormSubmitted()
>
> -igor
>
Thanks for the tip, Igor.
I have tried this, and my Form#onFormSubmitted() method is only called if
the FileUploadField field does not have an empty file selected. However, I
have found that my results depend on the internet browser used.
Using Mozilla Firefox (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)) I get the
blocking activity that I have already described (form submission requests by
submit components do not result in component or form submission).
Using Microsoft Internet Explorer 8 (version 8.0.6001.18702) all works fine
and an empty file does not block processing in any way.
I shall have to proceed, but I do not know whether my problem is a true bug
of Wicket or not. I have tried file upload components from other web sites
on Firefox and this problem does not arise.
I am not a developer of the Wicket framework. Is there any way I can submit
this behaviour as a potential bug for someone else to verify or not?
Thanks again for your questions and pointers anyway.
Ian Marshall
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25871355.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file is
selected
Posted by Igor Vaynberg <ig...@gmail.com>.
weird, you will have to debug and see what is happening.
a good place to start is Form#onFormSubmitted()
-igor
On Mon, Oct 12, 2009 at 10:08 AM, Ian Marshall
<ge...@gmail.com> wrote:
>
>
> igor.vaynberg wrote:
>>
>> do you have a feedback panel in your page, so you can see errors if they
>> happen?
>>
>> -igor
>>
> Yes, I have a feedback panel in my (base) page as set out in code below. I
> see nothing at all upon clicking. (I have set testing messages to appear in
> my feedback panel holding data about the uploaded files, so I know that my
> feedback panel works - and messages are shown for non-empty uploaded files!)
>
> Ian
>
>
> HTML code
> -----------
> <div wicket:id="fbpnlFeedbackPanel"/>
>
>
> Java code
> ----------
> public class PageBase extends WebPage
> {
> private static final long serialVersionUID = 1L;
>
> ...
>
> public PageBase()
> {
> this(null);
> }
>
> private PageBase(IModel model)
> {
> super(model);
>
> ...
>
> FeedbackPanel fbpnlFeedbackPanel = new
> FeedbackPanel("fbpnlFeedbackPanel");
> add(fbpnlFeedbackPanel);
> }
> }
>
>
> Button btnUpload = new Button("btnUpload")
> {
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onSubmit()
> { // Test code follows
> FileUpload fuUpload = fufUploadImage.getFileUpload();
> CloudSession ssnSession = (CloudSession)getSession();
>
> String sMsg = "From btnUpload.onSubmit():
> fufUploadImage.getFileUpload()";
> if (fuUpload == null)
> sMsg += " is null.";
> else
> {
> sMsg += String.format(" has size = %d, client file name = \"%s\","
> + " and content type = \"%s\".",
> fuUpload.getSize(), fuUpload.getClientFileName(),
> fuUpload.getContentType());
> }
> /**/ ssnSession.info(sMsg); // Showing a message in my feedback panel
> /**/
> ...
> }
> };
> btnUpload.setDefaultFormProcessing(false);
> frmForm.add(btnUpload);
>
> --
> View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25859544.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
FileUploadField blocks component submission when an empty file is
selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> do you have a feedback panel in your page, so you can see errors if they
> happen?
>
> -igor
>
Yes, I have a feedback panel in my (base) page as set out in code below. I
see nothing at all upon clicking. (I have set testing messages to appear in
my feedback panel holding data about the uploaded files, so I know that my
feedback panel works - and messages are shown for non-empty uploaded files!)
Ian
HTML code
-----------
<div wicket:id="fbpnlFeedbackPanel"/>
Java code
----------
public class PageBase extends WebPage
{
private static final long serialVersionUID = 1L;
...
public PageBase()
{
this(null);
}
private PageBase(IModel model)
{
super(model);
...
FeedbackPanel fbpnlFeedbackPanel = new
FeedbackPanel("fbpnlFeedbackPanel");
add(fbpnlFeedbackPanel);
}
}
Button btnUpload = new Button("btnUpload")
{
private static final long serialVersionUID = 1L;
@Override
public void onSubmit()
{ // Test code follows
FileUpload fuUpload = fufUploadImage.getFileUpload();
CloudSession ssnSession = (CloudSession)getSession();
String sMsg = "From btnUpload.onSubmit():
fufUploadImage.getFileUpload()";
if (fuUpload == null)
sMsg += " is null.";
else
{
sMsg += String.format(" has size = %d, client file name = \"%s\","
+ " and content type = \"%s\".",
fuUpload.getSize(), fuUpload.getClientFileName(),
fuUpload.getContentType());
}
/**/ ssnSession.info(sMsg); // Showing a message in my feedback panel
/**/
...
}
};
btnUpload.setDefaultFormProcessing(false);
frmForm.add(btnUpload);
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25859544.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file is
selected
Posted by Igor Vaynberg <ig...@gmail.com>.
do you have a feedback panel in your page, so you can see errors if they happen?
-igor
On Mon, Oct 12, 2009 at 9:21 AM, Ian Marshall
<ge...@gmail.com> wrote:
>
>
> igor.vaynberg wrote:
>>
>> so what form error do you see displayed?
>>
>> -igor
>>
> I see no error message. Within my form I have three submit buttons (I set
> out relevant code fragments below). Clicking any of these buttons does not
> result in their overridden onSubmit() methods being called (for the form's
> overridden onSubmit() method either). Something happens on the browser
> (Mozilla Firefox) since the waiting dots appear for a brief moment, but no
> change is apparent to me on the browser.
>
> I guess that something might be failing silently in my FileUploadField
> component instance, but I do not know how to proceed.
>
> Ian
>
>
> HTML code
> ----------
>
> <form wicket:id="frmForm">
> <input wicket:id="fufUploadImage" type="file" size="40"
> tabindex="3"/>
>
> <input type="submit" wicket:id="btnUpload" value="<---
> Upload file" tabindex="4"/>
>
> <input type="submit" wicket:id="btnOK" value="OK"
> tabindex="101"/>
>
> <wicket:enclosure child="btnCancel">
> <input type="submit" wicket:id="btnCancel" value="Cancel"
> tabindex="102"/>
> </wicket:enclosure>
> </form>
>
>
> Java code
> ----------
> public final class PageItem extends PageBase \\ PageBase descends from
> WebPage
> {
> private static final long serialVersionUID = 1L;
>
> Form frmForm = new Form("frmForm")
> {
> private static final long serialVersionUID = 1L;
>
> @Override
> protected void onSubmit()
> {
> ...
>
> //
> // Persist the item data here...
> //
> }
> };
> frmForm.setMultiPart(true); // To enable file uploading
> frmForm.setMaxSize(G_BY_MAX_SIZE_FILE_UPLOAD);
> frmForm.setModel(new CompoundPropertyModel(g_pidData));
> add(frmForm);
>
> final FileUploadField fufUploadImage =
> new FileUploadField("fufUploadImage");
> frmForm.add(fufUploadImage);
>
> Button btnUpload = new Button("btnUpload")
> {
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onSubmit()
> {
> ...
> }
> };
> btnUpload.setDefaultFormProcessing(false);
> frmForm.add(btnUpload);
>
> Button btnOK = new Button("btnOK");
> frmForm.add(btnOK);
>
> Button btnCancel = new Button("btnCancel")
> {
> private static final long serialVersionUID = 1L;
> @Override
> public void onSubmit()
> {
> ...
> setResponsePage(PageHome.class);
> }
> };
> btnCancel.setDefaultFormProcessing(false);
> frmForm.add(btnCancel);
> }
>
> --
> View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25858766.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
FileUploadField blocks component submission when an empty file is
selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> so what form error do you see displayed?
>
> -igor
>
I see no error message. Within my form I have three submit buttons (I set
out relevant code fragments below). Clicking any of these buttons does not
result in their overridden onSubmit() methods being called (for the form's
overridden onSubmit() method either). Something happens on the browser
(Mozilla Firefox) since the waiting dots appear for a brief moment, but no
change is apparent to me on the browser.
I guess that something might be failing silently in my FileUploadField
component instance, but I do not know how to proceed.
Ian
HTML code
----------
<form wicket:id="frmForm">
<input wicket:id="fufUploadImage" type="file" size="40"
tabindex="3"/>
<input type="submit" wicket:id="btnUpload" value="<---
Upload file" tabindex="4"/>
<input type="submit" wicket:id="btnOK" value="OK"
tabindex="101"/>
<wicket:enclosure child="btnCancel">
<input type="submit" wicket:id="btnCancel" value="Cancel"
tabindex="102"/>
</wicket:enclosure>
</form>
Java code
----------
public final class PageItem extends PageBase \\ PageBase descends from
WebPage
{
private static final long serialVersionUID = 1L;
Form frmForm = new Form("frmForm")
{
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit()
{
...
//
// Persist the item data here...
//
}
};
frmForm.setMultiPart(true); // To enable file uploading
frmForm.setMaxSize(G_BY_MAX_SIZE_FILE_UPLOAD);
frmForm.setModel(new CompoundPropertyModel(g_pidData));
add(frmForm);
final FileUploadField fufUploadImage =
new FileUploadField("fufUploadImage");
frmForm.add(fufUploadImage);
Button btnUpload = new Button("btnUpload")
{
private static final long serialVersionUID = 1L;
@Override
public void onSubmit()
{
...
}
};
btnUpload.setDefaultFormProcessing(false);
frmForm.add(btnUpload);
Button btnOK = new Button("btnOK");
frmForm.add(btnOK);
Button btnCancel = new Button("btnCancel")
{
private static final long serialVersionUID = 1L;
@Override
public void onSubmit()
{
...
setResponsePage(PageHome.class);
}
};
btnCancel.setDefaultFormProcessing(false);
frmForm.add(btnCancel);
}
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25858766.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FileUploadField blocks component submission when an empty file is
selected
Posted by Igor Vaynberg <ig...@gmail.com>.
so what form error do you see displayed?
-igor
On Mon, Oct 12, 2009 at 8:58 AM, Ian Marshall
<ge...@gmail.com> wrote:
>
>
> igor.vaynberg wrote:
>>
>> is your fileuploadfield marked as required?
>>
>
> No; I have not called the FileUploadField instance's setRequired(...)
> method.
>
> Ian Marshall
> --
> View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25858283.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
FileUploadField blocks component submission when an empty file is
selected
Posted by Ian Marshall <ge...@gmail.com>.
igor.vaynberg wrote:
>
> is your fileuploadfield marked as required?
>
No; I have not called the FileUploadField instance's setRequired(...)
method.
Ian Marshall
--
View this message in context: http://www.nabble.com/FileUploadField-blocks-component-submission-when-an-empty-file-is-selected-tp25855504p25858283.html
Sent from the Wicket - User mailing list archive at Nabble.com.