tag:blogger.com,1999:blog-3283609923804350642.post6745643163292398219..comments2023-06-05T23:03:15.094-07:00Comments on Tor Norbye's Blog: Creating downloadable filesTor Norbyehttp://www.blogger.com/profile/00746799716822637466noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-3283609923804350642.post-614016474386056602006-01-12T06:24:35.000-08:002006-01-12T06:24:35.000-08:00Sorry, I don't know anything about Tomahawk. Y...Sorry, I don't know anything about Tomahawk. You cannot always mix and match web frameworks -- JSF relies on redirects for navigation so if tomahawk is messing with state it could cause problems. It might be possible to make this work but I don't know anything about it - sorry.<br>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-38450092655546244212006-01-11T18:44:39.000-08:002006-01-11T18:44:39.000-08:00Thanks for reply,In my JSF code, I have a tomahawk...Thanks for reply,<br>In my JSF code, I have a tomahawk tag [t:saveState id="xxxManagerBean" value="xxxManagerBean"]. The export data functions correctly, but the navigation is lost because my data are lost after the export.<br>I think that the tomahawk tag [t:saveState ... ] does not keep good the values after export.<br>The same problem occurs as you use the attribute Target in [h:commandLink target="myNewPage"/>"]. after export, I lost my navigation.<br>Thanks in Advance.<br>Mounir MADRANEnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-86350979622404826012006-01-10T19:39:54.000-08:002006-01-10T19:39:54.000-08:00Hello,I am trying to navigate after an export data...Hello,<br>I am trying to navigate after an export data from JSF (I use POI to generate Excel-formatted spreadsheet files "CSV"). For that I use response.getOutPutStream() which works good (the export works),<br>but after this export, JSF lost the navigation (when I click on "h:commandLink" or "h:commandButton" to do other Action ...). I think that my data and my " <t:saveState id="xxxManagerBean" value="xxxManagerBean"> " are lost .<br>code for export:<br>//I use a download button : "h:commandButton immediate="true" action="#{myManagerBean.exportAction}" "<br>//FunctionAction.<br>public String exportAction() {<br>FacesContext context = FacesContext.getCurrentInstance();<br>HttpServletResponse response =<br>(HttpServletResponse)context.getExternalContext().getResponse();<br>response.setContentType("application/x-zip");<br>response.setContentType("Cache-Control", "no-store");<br>response.setContentType("Pragma", "");<br>response.setHeader("Content-disposition",<br>"attachment; filename=file.zip");<br>try {<br>exportExcel = new CSVExport(response.getOutputStream(), "nameFile.csv");<br>exportExcel.setCharSeparator(..);<br>exportExcel.exportData("List" or "ResultSet");<br>exportExcel.closeFile();<br>response.getOutputStream().flush();<br>response.getOutputStream().close();<br>context.responseComplete();<br>} catch (IOException e) {<br>e.printStackTrace();<br>}<br>return null;<br>}<br>Perhaps, this problem is caused by "context.responseComplete();" or the saveState lost data when I work white response !!!.<br>There is the same problem whith the "<h:commandLink target="myNewPage"/>", I lost my navigation.<br>Thanks in Advance.<br>Mounir MADRANEnoreply@blogger.com