pengwei0527 / gxt-multi-upload

Automatically exported from code.google.com/p/gxt-multi-upload
0 stars 0 forks source link

how to input type #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
where in your code you create a new InputElement the first time before call 
<code>
formPanel.getElement().appendChild(input); ???
</code>
I tried to modify the code to make UI simple, i used your same form panel and  
upload field:
<code>
addButton.addListener(Events.OnChange, new Listener<FieldEvent>() {
            @Override
            public void handleEvent(FieldEvent be) {

                    String value =addButton.getValue();
                    Node nodeChild = DOM.createElement("input");

                    InputElement input = nodeChild.cast();
                    input.setAttribute("type","file");
                    input.setName(value);
                    input.setAttribute("filename",value);

                    formPanel.getElement().appendChild(input);
                }
            }
</code>

When i sumbit the form, my servlet receive the req but the file written to the 
file system has size 0 byte;
I tested the servlet whit a simple form for upload file in a simple jsp and in 
this case the file was written right to the file system...the servlet works...

I think i'm wrong in writing and adding the input type to the form...

Have you an example or could you tell me where you implemented it in your code 
project? 
Thanks a lot, best regards

Original issue reported on code.google.com by davidema...@gmail.com on 24 Jun 2011 at 11:12

GoogleCodeExporter commented 9 years ago
Hi,

if I understood it right, you modified the code - addButton.addListener(..) 
method and you want to know where is InputElement created before first file add 
into file queue.

InputElement is created within GXT's FileUploadField - see Java source code of 
this class.

Hope this helps.
Best regards
Tomas

Original comment by tomas.k...@gmail.com on 29 Jun 2011 at 4:59

GoogleCodeExporter commented 9 years ago

Original comment by tomas.k...@gmail.com on 29 Jun 2011 at 5:21