7 Replies Latest reply on Feb 1, 2008 12:30 PM by limousyf

    Excel export and stateless bean

    limousyf

      Hello,

      I have a problem exporting my data to excel.
      I have a stateless bean containing a datatable (an annual report in fact).
      The data gathered in this report depends on two date selectors (the reports bounds).

      I designed two views, one for the browser, with the two date selectors, which works perfectly well, and one for excel, with a different template and content-type.

      On the browser view, I put a commandButton to validate any change on the dates and that works.
      I also put a commandLink to launch the excel view.
      Because it's in the same form, the dates are set correctly but the new view (the excel one) seems to use an other instance of the stateless bean (with default dates).

      I tried the many navigation modes but the problem remains.

      The only thing here is to use a statefull bean. In the same conversation, the same instance is used, everything works fine. But I can't use a stateful bean here, so I'm doomed :/

      Is there a way to set the dates after the redirection on the new view occur ? (it sounds like a stupid question regarding jsf-lifecycle but I need to ask ...)

      Thanks for any help on this