I'm trying to implement upload dialog with using modalPanel and fileUpload inside it - and found strange problem: if modalPanel included into form - item in uploadEvent is empty - all fields are null.
If modalPanel placed outside form - item passed correct (with fileName and file initialized).
Is it bug or feature? (In first case I will open ticket in Jira)
Here is example of code I'm using:
<emforge:panel id="attachmentsWithUploadPanel"
rendered="#{not empty attachmentList or showUpload}"
header="Attachments (#{fn:length(attachmentList)})">
<h:form id="attachmentPanelForm">
<input type="hidden" name="page" id="page" value="#{page}"/>
<ui:include src="attachmentlist.xhtml">
<ui:param name="formId" value="attachmentPanelForm"/>
<ui:param name="attachmentList" value="#{attachmentList}"/>
<ui:param name="page" value="#{page}"/>
</ui:include>
<h:outputLink value="javascript:Richfaces.showModalPanel('uploadDlg');">
<h:graphicImage url="resources/images/attachment_small.png"/>
<h:outputText value=" ${res.uploadNewAttachment}"/>
</h:outputLink>
<!-- Upload Dialog -->
<rich:modalPanel id="uploadDlg" autosized="true" resizeable="false" zindex="2000">
<f:facet name="header">
<h:outputText value="${res.uploadNewAttachment}" />
</f:facet>
<f:facet name="controls">
<h:graphicImage value="/resources/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('uploadDlg')" />
</f:facet>
<rich:fileUpload fileUploadListener="#{attachmentUploadController.upload}"
maxFilesQuantity="5"
immediateUpload="false"
autoclear="true">
<f:param name="page" value="#{page}"/>
<a4j:support event="onuploadcomplete" reRender="attachmentsWithUploadPanel"/>
</rich:fileUpload>
</rich:modalPanel>
</h:form>
</emforge:panel>