Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUpload Component did not display files stored in the current session #359

Open
rsoika opened this issue Mar 13, 2018 · 2 comments
Open
Labels

Comments

@rsoika
Copy link
Member

rsoika commented Mar 13, 2018

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.

@rsoika rsoika added this to the 4.2.7 milestone Mar 13, 2018
@rsoika rsoika changed the title FileUploadController - avoi reset FileUploadController - avoid early reset Mar 13, 2018
@rsoika rsoika added the wontfix label Mar 13, 2018
@rsoika
Copy link
Member Author

rsoika commented Mar 13, 2018

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...

@rsoika rsoika removed this from the 4.2.7 milestone Mar 13, 2018
@rsoika
Copy link
Member Author

rsoika commented Mar 14, 2018

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="&lt;a target='_balnk' href='" />
		<h:outputText escape="false"
			value="#{cc.attrs.context_url}/file/#{fileData.name}" />
			<h:outputText escape="false" value="'&gt;#{fileData.name}&lt;/a&gt;" />
		</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

  1. jsf validation error (missing input in required true)
  2. 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.

@rsoika rsoika changed the title FileUploadController - avoid early reset FileUpload Component did not display files stored in the current session Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant