我有一个包含两个 fileUpload 控件的页面:
<h:panelGroup id="distinctAttachmentsPanel" rendered="#{multipleSendingController.selectedAttachmentList == 2}">
<h:outputText value="Allegati distinti" />
<p:fileUpload id="distinctFileUpload" fileUploadListener="#{multipleSendingController.onDistinctFileUpload}"
mode="advanced"
multiple="true"
sizeLimit="100000000"
label="Sfoglia"
uploadLabel="Carica"
cancelLabel="Annulla"
update=":form:uploadedDistinctFiles" />
<p:selectManyCheckbox id="uploadedDistinctFiles" value="#{multipleSendingController.selectedDistinctAttachments}" converter="#{multipleSendingController.fileConverter}" layout="pageDirection">
<f:selectItems value="#{multipleSendingController.distinctAttachments}" var="a" itemLabel="#{a.name}" itemValue="#{a}" />
</p:selectManyCheckbox>
<h:outputText value="File excel" />
<p:fileUpload id="excelFileUpload" fileUploadListener="#{multipleSendingController.onExcelFileUpload}"
mode="advanced"
multiple="true"
sizeLimit="100000000"
label="Sfoglia"
uploadLabel="Carica"
cancelLabel="Annulla"
update=":form:uploadedExcelFiles" />
<p:selectManyCheckbox id="uploadedExcelFiles" value="#{multipleSendingController.selectedExcelFiles}" converter="#{multipleSendingController.fileConverter}" layout="pageDirection">
<f:selectItems value="#{multipleSendingController.excelFiles}" var="a" itemLabel="#{a.name}" itemValue="#{a}" />
</p:selectManyCheckbox>
</h:panelGroup>
当我在其中一个 fileUpload 控件中选择一个或多个文件时,相同的文件会出现在另一个控件中,就像它在那里被选中一样。我无法弄清楚发生了什么。