简体   繁体   中英

Primefaces Command button causes page reloading

I am working an primefaces application, I am using Primefaces 5.x version, Jsf 2.x

which has tabview in one of the tabs I have command button, by clicking on it pdf export should happen.

For the first time click on button page is getting reloaded, from the second time on words request is going to bean page and downloading is working correctly.

this is my code snippet for command button :

<h:form id="mainForm">

<p:tabView id="myId" activeIndex="#{bean.currentTabIndex}" dynamic="true" cache="false">

<p:tab title="vehicle" id="vehId" styleClass="panelBack">
    <h:form id="exportForm">
       // some code


<p:commandButton value="export"  process="@this"  actionListener="# {bean.export()}" ajax="false" id="exportButton" />
        </h:form>

    </h:form>

If I make dynamic = false, it's working. I mean after clicking export button request is going to bean class, export is working.

What would be the problem? Can somebody help me?

Thank you

是的,您的问题很可能是嵌套的,在JSF中是不允许的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM