The @Upload component allows informal parameters, but
are you sure that the accept attribute is valid html and recognized by
browsers.
In general, it's difficult to change the <input type="file"> control's
appearance
and (clientside) behavior due to security reasons. Maybe it's better to
create your
own Upload component and do the filtering server-side.
Also, take a look at:
http://www.irt.org/script/561.htm
http://www.irt.org/script/1154.htm
If the method in the first link works, you have to write some javascript
which will check the filename and which will get triggered on form submit.
A generic solution to implement this (in Tap4) would be to write an
AcceptValidator
, contributing the correct javascript to the onSubmit handler of your
form and bind
it to the @Upload component, i.e.
<component id="file" type="Upload">
<binding name="file" value="file"/>
<binding name="displayName" value="message:filename"/>
<binding name="validators" value="validators:accept=gif-jpeg-other"/>
</component>
Since I'm interested in this, i'll also look into it and report my findings.
Anjali Abraham wrote:
Hi All,
I have a scenario wherein in my html, I have a code something
like this:
<input type="file" jwcid="upload1" name="upload1"/>
I have a requirement of giving a filter to only .gif files can
be shown by default to the dialog box which get opened on click of "browse"
button of the type file. For that to do I need to modify my above html code
to something like this:
<input type="file" jwcid="upload1" name="upload1" accept="image/gif"/>
But here there is a problem, as in my input tag I am using
jwcid, I ignores all the attributes particular to html's.
That's the reason we need to enable javascripting for these
tags. How to do the same.......???????
How can I achieve the same "accept" attribute functionality
through Tapestry4...????????
Please respond with reply,
Thanks in advance,
Regards,
Anjali
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]