2nd export causes page reload

UI Components for JSF
sachem1414
Posts: 6
Joined: 13 Apr 2009, 22:27

13 Apr 2009, 22:48

I'm using PrimeFaces 0.8.2 and Optimus 0.7.2 with RichFaces 3.3.0.GA and Facelets 1.1.14.
I'm testing in Firefox 3.0.8 with Firebug.

I have rich:menuItems that export from a rich:dataTable.
For example:

Code: Select all

<rich:menuItem id="exportAsExcel" value="Excel" submitMode="server">
    <opt:exportActionListener type="xls" target="incidentList" fileName="incidents" excludeColumns="0" />
</rich:menuItem>
I'm having two problems:

(1) The 1st time I export, everything works great. But when I try to export a 2nd time, the entire page reloads and no export ever happens.

(2) After the page reloads, it no longer has the PrimeFaces resources in the head. And this breaks a p:lineChart that I have elsewhere on the page. Firebug appropriately shows a "YAHOO is not defined" error. My facelets template has p:resources in the head section and it all works perfectly before the export-induced page reload.


BTW, the exact same thing happens if I hook the opt:exportActionListener to a h:commandButton instead of the rich:menuItem. Has anyone ever seen this before?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Apr 2009, 23:07

I have a clue about the reason of this, I'll update this post soon after doing some testing.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Apr 2009, 10:14

Which state saving method are you using? client or server?

sachem1414
Posts: 6
Joined: 13 Apr 2009, 22:27

14 Apr 2009, 14:39

I don't know?

I'm also using Spring Web Flow 2.0.6.RELEASE (w/ Spring Faces).
I'm guessing that handles the state saving, probably server-side.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Apr 2009, 14:49

Just to test, can you try with adding this to web.xml

Code: Select all

<context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
</context-param>

sachem1414
Posts: 6
Joined: 13 Apr 2009, 22:27

14 Apr 2009, 15:16

I added that and had the same problems.

Based on the existence of this issue in Jira, I'm guessing that client-side state saving isn't possible yet with SWF2:
http://jira.springframework.org/browse/SWF-447

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

14 Apr 2009, 15:21

sachem1414 wrote:I'm using PrimeFaces 0.8.2 and Optimus 0.7.2 with RichFaces 3.3.0.GA and Facelets 1.1.14.
I'm testing in Firefox 3.0.8 with Firebug.

I have rich:menuItems that export from a rich:dataTable.
For example:

Code: Select all

<rich:menuItem id="exportAsExcel" value="Excel" submitMode="server">
    <opt:exportActionListener type="xls" target="incidentList" fileName="incidents" excludeColumns="0" />
</rich:menuItem>
I'm having two problems:

(1) The 1st time I export, everything works great. But when I try to export a 2nd time, the entire page reloads and no export ever happens.

(2) After the page reloads, it no longer has the PrimeFaces resources in the head. And this breaks a p:lineChart that I have elsewhere on the page. Firebug appropriately shows a "YAHOO is not defined" error. My facelets template has p:resources in the head section and it all works perfectly before the export-induced page reload.


BTW, the exact same thing happens if I hook the opt:exportActionListener to a h:commandButton instead of the rich:menuItem. Has anyone ever seen this before?
do you have a javascript error when you export for the 2nd time? maybe it is causing the entire page reloading.

sachem1414
Posts: 6
Joined: 13 Apr 2009, 22:27

14 Apr 2009, 16:35

No javascript errors reported by Firebug until after the reload.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Apr 2009, 17:16

SWF2 doesn't support client state saving, that's funny :) In our online demo, multiple exports on same page doesn't cause a problem, but demo has client state saving. Yigit can you please try with server state saving and share the results?

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

14 Apr 2009, 17:34

cagatay.civici wrote:SWF2 doesn't support client state saving, that's funny :) In our online demo, multiple exports on same page doesn't cause a problem, but demo has client state saving. Yigit can you please try with server state saving and share the results?
multiple exports with server state saving does not cause problems.

can you provide us a test case or war file so that we can test/debug etc.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests