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.
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.
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.
<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 falsein the SEAM component it doesn't stop the key inputs from working.
So I think that this is a SEAM related question.
Should I raise this as a JIRA or am I missing something about this component?
Have you tried the syntax
I just gave that a go and I'm experiencing the same behaviour.
I can still enter text into the field.