FileUpload Component did not display files stored in the current session
The FileUploadController stores files in different context (see below). As a result is seems that in case of a validation error the uploaded file is missing. THis is not the case! The file is only not displayed.
after all it seems not to be a to critical issue.
<input id="imixsFileUpload_input" type="file" name="files[]"
data-url="#{facesContext.externalContext.requestContextPath}/fileupload/"
multiple="multiple" />
Maybe the compoent is not able to show the files after a JSF lifecycle...
How this problem occurs
The FileUploadController has a method 'getUploades'. This is the only component able to display the files which are like in a 'bardo' similar state. This files are only in the session context - not yet in the workitem and no longer in html file input component
The imixsFileUpload.xhtml widget needs an additional table which is displaying the files from the 'FileUploadController.getUploades()' method. This table an also show delete buttons
This is an example for such a table in the imixsFileUpload.xhtml:
<h:dataTable value="#{fileUploadController.getUploades()}" var="fileData"
styleClass="imixsFileUpload_uploadlist">
<h:column>
<h:outputText escape="false" value="<a target='_balnk' href='" />
<h:outputText escape="false"
value="#{cc.attrs.context_url}/file/#{fileData.name}" />
<h:outputText escape="false" value="'>#{fileData.name}</a>" />
</h:column>
<h:column>
</h:column>
<!-- Loeschen -->
<h:column>
<h:commandLink value="#{global.delete}"
styleClass="imixsFileUpload_delete"
action="#{fileUploadController.removeAttachedFile(cc.attrs.workitem,fileData.name)}">
<f:ajax render=":#{component.parent.parent.parent.parent.clientId}"
onevent="function(data) { $('.imixsFileUpload').imixsLayout();updateFileUpload(); }" />
</h:commandLink>
</h:column>
</h:dataTable>
Is it solvable?
There are two different use cases
- jsf validation error (missing input in required true)
- Plugin Exception (rule validation)
Both cases result in different behavior. In case 1 the file is in the session context and an be displayed with the example above. In case 2 the file is already part of the workitem and is normally displayed. But in Imixs-Office-Workflow we have a different UI and do not display this kind of files which are not yet saved.
It would be solvable. But also we still have here the bug with multiple browser tabs which do share the same session - so parallel uploads always result in wrong behavior.
The solution is therefore more extensive and need to be solved with a new component at all.