Sorry for the noise above. It seems that Trinidad has built-in features to
overcome the HTML limitations on the file upload.
With one notes: the inputFile should be included in partial triggers.
With that, a tr:commandLink trigger PPR, and the inputFile element
will reset to 'empty value' after the PPR is completed.
On 9/18/07, Zarick Lau <[EMAIL PROTECTED]> wrote:
> Okay, it is not a problem with Trinidad, file upload control in HTML
> doesn't allow JavaScript to alter the "value" for security reason.
> Hence, Trinidad have nothing to do with it.
>
> On 9/17/07, Zarick Lau <[EMAIL PROTECTED]> wrote:
> > Dear Users and Developers,
> >
> > I've used tr:inputFile with PPR with success, however, after PPR
> > request is completed, the HTML form still leave the last file path
> > in the <input type="file" /> control.
> >
> > When user finally submit the form, the backing bean will
> > get another file, which are actually processed in last PPR request.
> >
> > I've tried the following code:
> >
> > public void onNewFileChange(ValueChangeEvent event) {
> > UploadedFile file = (UploadedFile) event.getNewValue();
> > log.debug("onNewFileChange: " + file);
> > if (file != null && file.getLength() > 0) {
> > setNewFile(file);
> > }
> > ((CoreInputFile)event.getComponent()).setValue(null);
> >
> > ((CoreInputFile)event.getComponent()).setLocalValueSet(true);
> > }
> >
> > But this doesn't work as expected.
> > How can I reset that input box?
> >
> > Best regards,
> > Zarick Lau
> >
>