首页 > 解决方案 > Primefaces DataExporter 只是刷新页面

问题描述

我有 MAIN jsf 页面,其中包含页眉/页脚和中心页面(动态):

<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions" 
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:form id="formC" enctype="multipart/form-data" update=":formC"> 
     <ui:insert name="content" >
        <ui:include src="/page/Bean.page"/>
     </ui:insert>
</h:form>
...

打开后,我无法从数据表中导出 csv/xls。

如果我单独打开页面(没有主页面 jsf,例如,如果我将数据表放在我的登录页面上)...导出完成!

在我的登录中,我有

...
<h:form>
<p:panel> 
            <h:commandLink immediate="true">
                <p:graphicImage name="../excel.png"/>
                <p:dataExporter type="xls" target="tbl" fileName="doc" pageOnly="true"/>
            </h:commandLink>
</p:panel>


    <p:dataTable id="tbl" var="car" value="#{Bean.countries}"
...

在我的主页上包含标签,它只是刷新我的页面。没有错误!怎么了?

使用 primefaces 3.5,poi - 3.8-20120326。

我对页面的初始标签有疑问。我的登录页面,导出是可以的,开始于

 <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core">

主页以

<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions" 
      xmlns:ui="http://java.sun.com/jsf/facelets">

标签: jsfprimefacesjsf-2jsf-2.2primefaces-extensions

解决方案


推荐阅读