i am trying to use ace:fileEntry component to upload files but i am keep getting errors that action method doesn't exist here's what i am trying:
1- ace:fileEntry component
<h:form>
<ace:fileEntry id="fileEntryComp"
label="File Entry"
relativePath="uploaded"
fileEntryListener="#{userBean.uploadFile}"/>
<h:commandButton value="Upload File" action="#{userBean.uploadFile}"/>
</h:form>
2- UserBean:
public void uploadFile(FileEntryEvent event) {
FileEntry fileEntry = (FileEntry) event.getSource();
FileEntryResults results = fileEntry.getResults();
for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
if (fileInfo.isSaved()) {
log.debug("########### FILE IS SAVED ########");
}
}
}
Exception:
javax.el.MethodNotFoundException: /uploadFiles.xhtml @32,81 action="#{userBean.uploadFile}": Method not found: com.myapp.beans.UserBean@2b066718.uploadFile()
how to set the method in this case ? someone will tell me that the method call in xhtml page should take a parameter as in the bean, but i will answer that i did as mentioned in the example here:
http://wiki.icefaces.org/display/ICE/FileEntry
please advise.
problem was that i was using action method with the command button which is not necessary, i just needed to add command button with no action, everything works fine now.