I have simple page that contains upload component. When I provide file for
upload and submit the form, validation can't pass.
This is part of Index.tml page:
<t:form t:id="upload" t:zone="displayZone">
<t:errors/>
<table>
<tr>
<td><p>File Path: </p></td>
<td><input t:type="upload" t:id="fileUpload"
t:value="file"
validate="required" /></td>
</tr>
<tr>
<td><input type="submit" value="Upload" /></td>
</tr>
</table>
</t:form>
------------------------
This is Index.java page:
public class Index {
@Property
private UploadedFile file;
@Property
@InjectComponent
private Zone displayZone;
@Persist
private IUnZiper unZiper;
@SetupRender
public void initialize() {
unZiper = new UnZiper();
}
@Property
private String currentFilePath;
public List<String> fileList() {
if (unZiper.isUnziped()) {
File outFile = new File(UnZiper.OUTPUT_FOLDER);
List<String> result = new ArrayList<String>();
for (String s : outFile.list()) {
result.add(s);
}
return result;
}
return null;
}
public Object onSuccess() {
System.out.println("Hello: " + file.getFileName());
unZiper.unzip(new File(file.getFileName()));
return displayZone.getBody();
}
}
-----------------
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Upload-file-problem-tp5590513p5590513.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]