我有一个带有 2 个标签的标签视图。我想为每个选项卡使用两个 uploadFile 组件。我对 uploadFile 组件使用“高级”模式。当我尝试为第一个选项卡 uploadFile 组件上传无效文件(可能存在无效文件大小错误或无效文件类型错误)时,两个选项卡 uploadFile 组件都会显示错误消息。我使用 PF 3.4.1。在 pf_user_guide_3.4 中,写了“目前不支持同格式的多个高级上传器”。我的问题与此说明有关吗?有没有人对这种情况有想法?
main.xhtml
..........
<h:form id="formTabView">
<p:tabView id="tvSample" activeIndex="#{sampleBean.selectedTab}" cache="false">
<p:tab id="tabSubMerchants" title="#{messagebundle.submerc_tab_submerch}">
<ui:include src="tabsubmerchantssubmtab.xhtml" />
</p:tab>
<p:tab id="tabServices" title="#{messagebundle.submerc_tab_svc}">
<ui:include src="tabsubmerchantssevicestab.xhtml" />
</p:tab>
</p:tabView>
</h:form>
...........
tabsubmerchantssubmtab.xhtml
...........
<h:form id="formTab1Files">
<p:fileUpload id="fuSubMerchant"
fileUploadListener="#{fileOperations.uploadSubMerchantFile}"
sizeLimit="2097152" multiple="true"
allowTypes="/(\.|\/)(gif|jpeg|png|txt|pdf|doc|docx)$/"
label="#{messagebundle.fileupload_upload}" auto="true"
invalidFileMessage="#{messagebundle.submerc_error_011}"
invalidSizeMessage="#{messagebundle.submerc_error_012}">
</p:fileUpload>
</h:form>
..............
tabsubmerchantssevicestab.xhtml
...................
<h:form id="formSvcFiles">
<p:fileUpload id="fuService"
fileUploadListener="#{fileOperations.uploadServiceFile}"
sizeLimit="2097152" multiple="true"
allowTypes="/(\.|\/)(gif|jpeg|png|txt|pdf|doc|docx)$/"
label="#{messagebundle.fileupload_upload}" auto="true"
invalidFileMessage="#{messagebundle.submerc_error_011}"
invalidSizeMessage="#{messagebundle.submerc_error_012}">
</p:fileUpload>
</h:form>
.....................