I have a PDF document and i want to show the document in the modal window. So i have created a Embedded Resource and added it to the window. It opens fine. When i close it (by clicking X button on top right) from IE browser, it closes the window but the PDF document remains there. It stays on the browser like a popup. As i created modal window, i cannot access the other portions of the page. The only way to get out of this is by refreshing the page.
It happens only IE browsers(i have v9).
//SAMPLE CODE....
VerticalLayout verticalLayout=new VerticalLayout();
Embedded embeddedResource = new Embedded("", new ExternalResource(UrlOfThePdf));
embeddedResource.setHeight("630px");
embeddedResource.setWidth("650px");
embeddedResource.setMimeType("application/pdf");
embeddedResource.setType(Embedded.TYPE_BROWSER);
verticalLayout.addComponent(embeddedResource);
verticalLayout.setComponentAlignment(embeddedResource,Alignment.MIDDLE_CENTER);
This verticalLayout is later added to a modal window.
Any idea…how to address this.[i]
Which Vaadin version are you using?
There were/are several issues with embedded pdfs blocking windows (as described
here and
here ) but your problem is new to me.
You could try to add a WindowCloseListener to your window and hide (setVisible(false)) or remove the Embedded(verticalLayout.removeComponent(embeddedResource)) in the close method.
I am using vaadin 6. But i see the same problem in vaadin 7 too( running on a different machine). I have tried writing CloseListener and overriding the ‘close()’ method. I have tried removing all components for the window in those methods. Did not work. I could still see the PDF is not closed. It still sticks on the page.
I have found another artilce on this, but there is no answer for this.
It happens only in IE browsers. Works fine in Firfox and Chrome. Does this require any browser specific plugins… I can upgrade my browser and see, But we should support IE 9 too.
Do we have any other options of opening PDF apart from using Embedded object…?