0

当我将下载链接放入对话框时遇到此问题,它不起作用,但是当我将它放入 panelgrid 时,它起作用是 primefaces 中的错误还是什么?你有什么主意吗

4

1 回答 1

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>
于 2012-09-21T08:06:45.787 回答