-
Notifications
You must be signed in to change notification settings - Fork 754
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 not working on Liferay 6.2 when other JSF portlet exists on page #2025
Comments
Would you please try a trunk build? We fixed many of small bugs on the new dynamic resource loading feature. |
you mean PF 6.1-SNAPSHOT from branch master in github? |
Just download the master from github and build it -> https://github.com/primefaces/primefaces/wiki/Building-From-Source |
Unfortunately - still the same: (and: Widget not available: Layout) |
@stiemannkj1 Do you have time to check that issue? Seems to be related to dynamic resource loading. I thought we catched all the issues :/ |
@lwojtysiak, you are using an old version of Liferay Faces. Please upgrade to our newest jars (you can use our archetype portlet to determine which dependencies and versions you need) and let us know if the issue persists. |
Sorry, but I cannot upgrade all libraries in my environment. I had some problems with Primefaces and I suppose, that upgrading Liferay Faces will have some more problems... Anyway - with Primefaces 5.3 everything (in that case) worked. Primefaces.js was loaded twice (in head and in body -> as in 6.0), but probably Primefaces.widget wasn't cleared (there is line to clear it, but I think it wasn't called, because of check that Primefaces is already loaded). It seems like this check is not working on Primefaces 6.0 - nothing more changed in my code (and liferays also) |
@lwojtysiak, Liferay Faces If you want, you could upgrade your development environment to use the latest versions of Liferay Faces, see if the issue is still there, and report it. However, that bug would only be fixed in the latest Liferay Faces versions (in the new version scheme). |
In my opinion, problem is not with Liferay Faces and putting this script second time in HTML. |
likely fixed the core.js reloading. component.js were always reloaded, so i didn't change this behavior. Please try. |
Looks better, because Primefaces.widget contains FileUpload. |
No idea, sry. If you can reproduce it with a simple maven/jetty application, i can check it. Otherwise please investigate by yourself or upgrade liferay. |
Will close it for now. If we can fix something, please comeback. |
IMPORTANT
I have a problem with FileUpload component placed on webpage with twoi portlets.
First portlet is placed as runtime in Liferay theme, and the second one is "normal" portlet with file upload component.
The problem is that while trying to select file from system dialog and push "Select" - nothing happens. File is not showing in component and it is not possible to upload it.
In javascript I can see error "FileUpload is not defined".
When I debugging DOM in FF, I can see
Primefaces.widget array, where actually FileUpload is not available.
This situation worked at Primefaces 5.3 and not working on PF 6.0
As i think, the problem is with:
in core.js I can see the line to clear Primefaces.widget array, and in components.js there is code which adds basic component to this array - but not FileUpload (and SimpleFileUpload, and as I remember one more).
The problem is that when Liferay loads resources for webpage, it places all resources in head (for example fileupload.js from second portlet) In this way - everything is ok, because core.js and components.js are placed "higher".
The problem is that when we have runtime portlet, it's resources are placed in at the end or JSF portlet.
Because of that we have such situation in result HTML:
There is line:
if(window.PrimeFaces){window.PrimeFaces.debug("PrimeFaces already loaded, ignoring duplicate execution.");return
in core.js
but as I think - it's not working, and after loading core.js second time... it's clearing Primefaces.widget once again, and because fileupload.js not exists second time - it's "not loaded".
1) Environment
2) Expected behavior
FileUpload component shows selected file (or error message if not correct file chosen) and give possibility to upload
3) Actual behavior
After selecting file in FileUpload component nothing happens
4) Steps to reproduce
Liferay web page with:
$theme.runtime("portlet_name");
5) Sample XHTML
<p:fileUpload id="fileId" update="@this,fileNamePanelId" auto="true" value="#{cc.attrs.fileUpload}" label="#{cc.attrs.fileUploadLabel}"
allowTypes="#{cc.attrs.allowTypes}" invalidFileMessage="#{cc.attrs.invalidFileMessage}"
fileUploadListener="#{cc.attrs.bean.handleFileUpload}" fileLimit="1" required="true" disabled="#{cc.attrs.disabled}" />
6) Sample bean
Not important
The text was updated successfully, but these errors were encountered: