Hi,
I've been working on Image file upload and display. With the help of a
previous thread, I was able to get a fully working test component that
could have a client upload a file from a form, and then have the file
saved on the server and rendered back to the client in the browser.
I've moved on to integration of this concept into my actual application.
I'm having an issue capturing the UploadedFile in any event handlers on
a page where the form is within a Zone. The form is also within a Block
that is delegated in case that factors in at all.
When the form is submitted, the UploadedFile object is null, and thus I
cannot handle the object.
In my test component, the UploadedFile object resolves to a reference to
the Image file uploaded by the client (had they uploaded one and no
exception occurred). I did another sanity check by integrating the
upload component into another form for the same Entity in my application
that is not within a Zone or Block. The UploadedFile object was valid in
this page as well after form submit, leaving me to think there is
something about the Zone or Block that is interfering with the results I
expected.
This is how I have been using the Upload component
Page:
@Property
private UploadedFile uploadedFile;
public void onSuccess(){
if(uploadedFile == null){
log.debug("Image file was not provided");
}else{
imageManager.saveImage(uploadedFile);
}
}
TML:
<input t:type="upload" t:id="uploadedFile" />
Also since I'd had a couple threads recently where I had forgot to use
the t:zone attribute properly, I tried out t:zone on the upload
component to sanity check that as well, but that did not appear to
change anything.
Is anyone familiar with what challenge(s) I may be facing here in
getting the upload to work?
Thanks,
Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org