1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <script>
function switchUploadControl(id, expanded) {
var button = $(id + :upload2);
if(expanded) {
Element.hide(button.parentNode);
} else {
Element.show(button.parentNode);
}
}
</script>
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" id="upload"
uploadControlLabel="<i>Upload1</i>"
immediateUpload="#{fileUploadBean.autoUpload}"
acceptedTypes="jpg, gif, png, bmp"
allowFlash="#{fileUploadBean.useFlash}">
<a4j:support event="onuploadcomplete" reRender="info" />
</rich:fileUpload>
<button type="button"
onclick="switchUploadControl('#{rich:clientId('upload')}',false);">enable</button>
<button type="button"
onclick="switchUploadControl('#{rich:clientId('upload')}',true);">disable</button> |