Hello,
I need to to display dynamically generated PDFs from my application and I use custom StreamSource to generate and serve PDFs. That is all fine, however i have two questions:
- What would be the best option to handle errors and inform user if something goes wrong, if exception is thrown during PDF generation? When I call open(streamSource), PDF generation is actually called by vaadin and I can’t really handle exceptional situations myself. Is there any other way to let browser open PDF without using window.open()?
This brings me to second, more important question:
- when using window.open(streamSource), the biggest problem is that vaadin does not recommend using “_self” as a target so i use “_blank”. This will make vaadin open a popup or a onther browser window to serve pdf. BUT, if exception occurs, popup (or another window) is filled with the application content and remains opened. That brings me to two application windows, the first is out-of-sync, another is ok. Is there any way to avoid this situation wiith two windows if exception in getStream occurs.
Actually, everything would be ok, if vaadin would display anything (error msg) except the application content in the new window. In that case user would be able to continue using the app without out-of-sync errors.
i would appreciate any help, advice or discussion on this subject(s).
Thanks.