-
1. Re: rich:fileUpload behaviour
pvito Dec 2, 2011 5:59 AM (in response to palbergan)Hi,
try set properties domElementAttachment="form" in rich:popupPanel,
like this:
<h:form>
<rich:popupPanel domElementAttachment="form" modal="true">
</rich:popupPanel>
<h:form>
-
2. Re: rich:fileUpload behaviour
palbergan Dec 6, 2011 8:55 AM (in response to pvito)Thanks for the answer. I have now investigated further on the problem. I turns out that my problem has nothing to do with the modal panel. It has to do with composite components. In order to see the problem do as follows:
1. Click 'UPLOAD' to show the file upload component.
2. Click the 'Add' button and select a file.
3. Click the 'Close' button to hide the file upload component.
4. Click 'UPLOAD'.
5. Click the 'Add' button and select a file.
6. Click the 'Upload' button in the file upload component.
As you can see nothing happens. The component does not do anything. If you skip 3,4 and 5 the file is uploaded. Very odd.
Here is the component code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<cc:interface>
<cc:attribute name="showButton" default="true"/>
</cc:interface>
<cc:implementation>
<h:commandButton id="uploadFile" value="UPLOAD"
disabled="#{!cc.attrs.showButton}">
<f:ajax execute="@this" render="fileUploadPanel" />
<f:setPropertyActionListener value="true"
target="#{fileUploadBean.show}" />
</h:commandButton>
<h:panelGroup id="fileUploadPanel">
<h:panelGroup rendered="#{fileUploadBean.show}">
<rich:fileUpload id="fileUpload" acceptedTypes="txt"
fileUploadListener="#{fileUploadBean.uploadDone}">
<f:ajax execute="@form" event="uploadcomplete"
listener="#{fileUploadBean.uploadCompleted}" render="" />
</rich:fileUpload>
<h:commandButton id="close" value="Close">
<f:ajax execute="@this" render="fileUploadPanel" />
<f:setPropertyActionListener value="false"
target="#{fileUploadBean.show}" />
</h:commandButton>
</h:panelGroup>
</h:panelGroup>
</cc:implementation>
</html>
//*********************Components use file**********
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:showcase="http://java.sun.com/jsf/composite/showcase"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:scomp="http://www.skd.no/jsf/composite"
xmlns:sfunk="http://www.skd.no/jsf/funksjoner">
<body>
<ui:component>
<h:form id="form">
<showcase:demoComponent id="uploadFile"/>
</h:form>
</ui:component>
</body>
</html>
-
3. Re: rich:fileUpload behaviour
palbergan Mar 5, 2012 2:29 AM (in response to palbergan)1 of 1 people found this helpfulI have today installed Richfaces 4.2.0.Final version and now all problems with the component is solved. Now it also understand the MaxFilesQuantity parameters and internal lists are reset correct it seems when downloading the same file twice. Finally my problems are solved!