Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.1
-
Fix Version/s: 1.8.2
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
Description
When using the ice:dataExporter with a browser with popup-blocking enabled (Safari, FF, etc.) the data export will fail, unless the user disables popup blocking in the browser. In Safari, it's particularly bad as the browser does not give any indication that the popup is being blocked, leaving the user to wonder why his export isn't working.
If possible, we should rework the dataExporter to avoid trigger popup blockers. I've noticed that the ice:outputResource component manages to download files without triggering it, so perhaps it could be used as a reference for the proper technique.
If possible, we should rework the dataExporter to avoid trigger popup blockers. I've noticed that the ice:outputResource component manages to download files without triggering it, so perhaps it could be used as a reference for the proper technique.
Fact: Any window.open() call will be caught by the popup blocker which has been made without user interaction or executed by eval().
Both components use window.open(), but the difference is that the outputResource pre-renderes the resource path to the onclick attribute of the commandButton , so when user clicks on the button it directly makes the window.open() call which invokes a servlet and JSF Lifecycle never gets executed. While the dataExporter download link causes a JSF life cycle to be begin, during the lifecycle component creates appropriate file makes window.open() call using JavaScript context API, which obviously uses eval() that is why dataExporter caught by the popup blocker.
Seems like there isn't any javascript solution or technique.