-
1. Re: s:fileUpload quick question
danielc.roth Mar 15, 2009 12:45 AM (in response to kragoth)This is really not Seam-related. Seam just renders the ordinary input tag with type set to file. Check javascript forums... :-)
-
2. Re: s:fileUpload quick question
francof Mar 15, 2009 3:07 AM (in response to kragoth)I bet you could use jQuery to your advantage.
With jQuery you could just make the input field of the this control go poof! - just give the control an id that you can use in the onReady event of jQuery. View source to see if id is applied to text box or browse button.
Another idea would be to enclose the control in a span, use the span's id, use jQuery find syntax to look for any input text fields within this span and hide them.Sorry if I am vague here, don't have any code to play with but I would definitely look at a jQuery solution.
-
3. Re: s:fileUpload quick question
francof Mar 15, 2009 2:41 PM (in response to kragoth)On second thought perhaps on hiding the input field the upload control will not work as expected ?, you could set it to disabled or read-only instead with jQuery
Another option is to that a keypress in the input field should trigger the Browse button click, kinda like how rich:calendar works.
-
4. Re: s:fileUpload quick question
kragoth Mar 16, 2009 12:11 AM (in response to kragoth)Hi Franco,
Thanks for your ideas! I havn't tried jQuery yet and I'm not sure I want to introduce another technology into my project at the moment.
I would be happy enough with keypress clicking the browse button. But I'm not sure how to do that as the browse button does not have any id.
I would even be happy with just ignoring all keypress events, but it seams that the way that SEAM renders this component out it is impossible to do that.
Daniel Roth,
This isn't really a javascript question because without SEAM I can get the desired behaviour. If I just write plain html I can get the component to work in a way that would satisfy my requirements. However using the s:fileUpload component does not let me do this.
<input id="testInput" type="file" onkeypress="return false;"></input>
The above line of code works fine in plain Html. This will stop all keyboard entry. However, if i use the onkeypress=
return false
in the SEAM component it doesn't stop the key inputs from working.So I think that this is a SEAM related question.
-
5. Re: s:fileUpload quick question
kragoth Mar 16, 2009 11:58 PM (in response to kragoth)Should I raise this as a JIRA or am I missing something about this component?
-
6. Re: s:fileUpload quick question
pregnirit Mar 17, 2009 3:55 PM (in response to kragoth)Have you tried the syntax
JavaScript:return false;
? -
7. Re: s:fileUpload quick question
kragoth Mar 17, 2009 11:51 PM (in response to kragoth)I just gave that a go and I'm experiencing the same behaviour.
I can still enter text into the field.