Hi,

i'm not shure, but i think your lifecircle problem is simular to this in
ajax requests.

For server side state saving there is additionaly to the
responseComplete() call a state saving done.

see sandbox AjaxPhaseListerner for details.

regards
  Volker

Lucio Piccoli wrote:
> hi all,
> 
> i have deployed a jsf app that has commandButton linked to 
> 
> [code]<h:commandButton actionListener="#{reportForm.renderListener}" 
> value="#{example_messages['button_report']}" />[/code]
> 
> a backing bean action that streams out a PDF and then calls responseComplete.
> 
> [code]
> FacesContext context = FacesContext.getCurrentInstance();  
>                               HttpServletResponse response = 
> (HttpServletResponse)context.getExternalContext().getResponse();
>                                                       
> byte[] bytes = JasperRunManager.runReportToPdf(  
> jasperReportFile.getFile(),parameters, dataSource.getConnection()    );
>                               
> response.setContentType( "application/pdf" );
> response.setContentLength(bytes.length);
> response.setHeader( "Content-disposition", 
> "attachment;filename=DepreciationSummaryReport.pdf");
> OutputStream out = response.getOutputStream();
> out.write( bytes );
> context.responseComplete();[/code]                                            
>         
> 
> 
> Everything works fine when the button is clicked #1 and the pdf is 
> downloaded. However the *newly* refreshed page does not behavior when the 
> same button is clicked #2. It takes another click #3 before the action fires 
> agains. The phaseTracker idenitfies the following phases invoked on click #2.
> 
> [code]INFO: AFTER INVOKE_APPLICATION(5)
> 15:34:44,370 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RESTORE_VIEW(1)
> 15:34:44,370 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RESTORE_VIEW(1)
> 15:34:44,370 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RESTORE_VIEW(1)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RESTORE_VIEW(1)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RESTORE_VIEW(1)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RESTORE_VIEW(1)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RENDER_RESPONSE(6)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RENDER_RESPONSE(6)
> 15:34:44,385 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> beforePhase
> INFO: BEFORE RENDER_RESPONSE(6)
> 15:34:44,417 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RENDER_RESPONSE(6)
> 15:34:44,417 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RENDER_RESPONSE(6)
> 15:34:44,417 INFO  [STDOUT] 27/10/2005 15:34:44 org.exadel.jsf.PhaseTracker 
> afterPhase
> INFO: AFTER RENDER_RESPONSE(6)[/code]
> 
> The application phase is not being invoked. 
> 
> Any ideas?
> 
> -lp
> 
> 
> 
> 
> **********************************************************************
>    This message has passed through an insecure network.
>     Please direct all enquiries to the message author.
> **********************************************************************
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Reply via email to