Hi,

First, I have a question : is it possible to use  MultiFileUploadField,
UploadProgressBar together?or UploadProgressBar is only for simpleUpload?

Secondly, I have a problem to use MultiFileUploadField (I adapt the example
http://wicketstuff.org/wicket13/upload/multi). For the moment, I can add
files into the ListView of uploaded files. But I have I exception when i try
to upload (so go to onSubmit)... 

This is my code of my form: 
*******************************************************
                this.form_importerarticle = new Form("form_importerarticle") {
                        protected void onSubmit() {
                                Iterator it = list_file.iterator(); 
                    while (it.hasNext())
                    {
                        final FileUpload upload = (FileUpload)it.next();
                        // Create a new file
                        File newFile = new File(getUploadFolder(),
upload.getClientFileName());
                        // Check new file, delete if it allready existed
                        checkFileExists(newFile);
                        try
                        {
                                log.info("test5");
                            // Save to new file
                            newFile.createNewFile();
                            upload.writeTo(newFile);
                        }
                        catch (Exception e)
                        {
                            throw new IllegalStateException("Unable to write
file");
                        }
                    }
                        }
                };
                this.form_importerarticle.setMultiPart(true);
                this.form_importerarticle.add(new 
MultiFileUploadField("fileInput", 10));
                this.form_importerarticle.setMaxSize(Bytes.megabytes(30));

*******************************************************
I populated my ListView like this :
                this.listview_file = new ListView("listview_file", list_file) {
            protected void populateItem(ListItem listItem)
            {
                final File file = (File)listItem.getModelObject();
                listItem.add(new Label("file", file.getName()));
                listItem.add(new Link("delete_file")
                {
                    public void onClick()
                    {
                        Files.remove(file);
                        //this.uploadFeedback.info("Suppression du fichier "
+ file);
                    }
                });
            }
        };
        this.form_importerarticle.add(listview_file);
        this.form_importerarticle.add(this.uploadFeedback);


I have also added this in my WebApplication class of my projet (to allow
upload???)
    protected WebRequest newWebRequest(HttpServletRequest servletRequest)
    {
        return new UploadWebRequest(servletRequest);
    }

Finally this is my exception : 
*********************************************************
ERROR [http-8080-1] (RequestCycle.java:1413) - Method onFormSubmitted of
interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
component [MarkupContainer [Component id = form_importerarticle, page =
com.mycompany.projet.ProjetPage, path =
7:panelprojet:form_importerarticle.PanelAjInfCommunautaire$1, isVisible =
true, isVersioned = true]] threw an exception
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of
interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
component [MarkupContainer [Component id = form_importerarticle, page =
com.mycompany.projet.ProjetPage, path =
7:panelprojet:form_importerarticle.PanelAjInfCommunautaire$1, isVisible =
true, isVersioned = true]] threw an exception
        at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:194)
        at
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
        at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
        at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
        at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
        at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)

When I try to upload, it doesn't enter into the method onSubmit of the form,
so I think I miss something....

TRhank you for your help :) :)
-- 
View this message in context: 
http://www.nabble.com/Problems-and-Questions-about-MultiFileUploadField%2C-UploadProgressBar-tp16445359p16445359.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to