2012-12-27 24 views
3

我有一个tabview有2个选项卡。我想为每个选项卡使用两个uploadFile组件。我对uploadFile组件使用“高级”模式。当我尝试上载第一个tab uploadFile组件的无效文件(可能有无效的文件大小错误或无效的文件类型错误)时,将显示两个制表符uploadFile组件的错误消息。我使用PF 3.4.1。在pf_user_guide_3.4中,编写了“目前不支持同一形式的多个高级上传器”。我的问题与本说明有关吗?有没有人对这种情况有所了解?我如何使用两个uploadFile组件?

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>   

.....................

回答

1

你有一个表格,里面这是两个多形式。我认为你应该删除父窗体,并留下标签内的表单。

+0

嘿patlov,谢谢你的回复。它工作正常:)当我删除表格封装tabview。我猜它不适用于嵌套窗体。 – ttakci

+0

嵌套形式是不正常的事情。你不应该在任何情况下使用它。不用谢。 – partlov