2012-08-12 86 views
0

我有這個問題 當我把下載鏈接到一個對話框它不起作用,但是當我把它放到panelgrid它的工作 它是一個在primefaces或什麼的bug ? 你有什麼想法下載不起作用對話框jsf2 primefaces

+0

在對話框中有嵌套窗體的機會嗎? – Daniel 2012-08-12 13:47:59

+0

我不明白你的意思 – begiPass 2012-08-12 14:05:29

+0

我只是明白爲什麼不爲我工作,當我把對話框中的下載鏈接它的作品,但如果它是在UI內:重複它不工作:我只是測試這是:你有任何想法讓這個組件在UI內工作:重複,謝謝 – begiPass 2012-08-12 14:29:59

回答

0
<h:form> 
     <p:panel header="Query"> 
      <.......some come is here ........ 
         <p:commandButton value="Export CSV" icon="ui-icon-document" 
          process="@this" rendered="#{xxx.showTable}" 
          oncomplete="exportConfirmationDialogShow.show()"></p:commandButton> 
        </h:panelGrid> 
       </p:outputPanel> 
      </h:panelGrid>    
     </p:panel> 

    </h:form> 

對話框;

<p:dialog header="Choose Delimiter Type" id="dialogCSV" 
     widgetVar="exportConfirmationDialogShow" resizable="false"> 
     <h:form id="csvForm"> 
      <h:panelGrid columns="2" style="margin-bottom:10px"> 
       <h:outputLabel value="Delimiter:" /> 
       <p:selectOneRadio id="delimiter" value="#{xxx.delimiterType}"> 
        <f:selectItem itemLabel="Tab" itemValue="tab" /> 
        <f:selectItem itemLabel="Pipe" itemValue="|" /> 
        <f:selectItem itemLabel="Comma" itemValue="," />       
       </p:selectOneRadio> 
      </h:panelGrid> 

      <p:commandButton id="exportCsv" value="Export CSV" 
       actionListener="#{xxx.export2CSV}" ajax="false" 
       onclick="PrimeFaces.monitorDownload(hideStatus)"> 
       <p:fileDownload value="#{xxx.exportFile}" 
        contentDisposition="attachment" /> 
      </p:commandButton> 

     </h:form> 
     <script type="text/javascript"> 
      function showStatus() { 
       exportConfirmationDialogShow.show(); 
      } 

      function hideStatus() { 
       exportConfirmationDialogShow.hide(); 
      } 
     </script> 
    </p:dialog> 
+0

我們在這裏比較喜歡它,如果您在回答中包含了這段代碼的工作原理的簡要說明,以及它如何回答原來的問題。這有助於使這些答案成爲其他人更好的資源。 – joran 2012-09-22 20:50:32