1
votes

I am using icefaces 3. My problem is i have a ace:fileEntry which has a fileEntryListener. I have a h:commandButton which has an actionListener set, at the end of my form. When i click on my commandButton , i notice that only my actionListener of the button gets called, but the fileEntryListener does not gets called completely. By this what i mean is the file gets uploaded into temp location, but my my actual code inside fileEntryListerner is not called. I have written a customer logic in my fileEntryListerner to copy the uploaded file to another location , and this is not working. Below is my code. Can anyone plese explain why the fileEntryListner code is not working fully.

            <td>
                <ace:fileEntry id="file-entry" label="Attachment"
                    absolutePath="/STR_UPLOADED_FILES"
                    maxFileCount="1" 
                    maxFileCountMessage="Limited to 1 files uploaded concurrently." 
                    fileEntryListener="#{strformbean.fileuploadListener}"
                    maxFileSize="6291456" 
                    maxFileSizeMessage="Submitted file is too large.Max size allowed is 6MB" 
                    maxTotalSize="6291456" 
                    maxTotalSizeMessage="Total size of submitted files is too large." 
                    required="false" 
                    requiredMessage="The file is required to submit this form." 
                    useOriginalFilename="false"  
                    useSessionSubdir="false"  />

            </td>
            <td colspan="2"  class="sectionHeader"  align="center"> 
                <h:commandButton id="submitM" type="submit" value="SAVE" action="strform" actionListener="#{strformbean.saveSTR}"/> 
            </td>


public void fileuploadListener(FileEntryEvent e)throws Exception {
    log.info("Inside fileuploadListener started....");
    FileEntry fe                = (FileEntry)e.getComponent();
    FileEntryResults results    = fe.getResults();
    File parent                 = null;
    ArrayList fileData          = new ArrayList<String>

............

The above logger info line does not print at all, but the file is uploaded.

2
i used FileEntryResults object to get the file details in my actionListener about the file and then i wrote my serialization code.ZEE

2 Answers

0
votes

Try removing the action and action Listener on h commandButton. hope this works.

0
votes
Try using <h:form> instead of <ice:form> as your form tag

Also <h:commandButton> should not include "action" or "actionListener" attributes.