views:

881

answers:

2

there are clear, clear all buttons on richfaces fileUpload component.

<rich:fileUpload id="quoteFile" tabindex="10" listHeight="80" maxFilesQuantity="1" onuploadcanceled="" 
 clearControlLabel=""
 clearAllControlLabel=""
 acceptedTypes="xml"
 fileUploadListener="#{loadSaveQuotes.uploadListener}">     
 <a4j:support event="onuploadcanceled" action="#{loadSaveQuotes.clearUploadData}" reRender="footer"  />
</rich:fileUpload>

all I want to are:

1, remove the both buttons so that end user cannot click it. as I set clearControlLabel to "", and clearAllControlLabel to "", but only clearControlLabel is hidden. still have clear All Control appear as [x] button and I still click it

2, if I cannot remove these button, so how do I take control of them. like add an event listener to that on clear event. I added an a4j:support event but it do not trigger when I click clear button.

many thanks for your contribute.

+1  A: 

Add an a4j:support for 'onclear' JavaScript event. The code is self-explanatory:

<rich:fileUpload id="upload">
    <a4j:support event="onclear" reRender="upload"/>
</rich:fileUpload>
mgryszko
A: 

thanks mgryszko Your solution was very usefull to me.

Ahmed Abbas

related questions