ICEfaces
  1. ICEfaces
  2. ICE-4955

ice:dataExporter fails if browser popup-blocker is enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

        Activity

        Hide
        Adnan Durrani added a comment -

        Fact: Any window.open() call will be caught by the popup blocker which has been made without user interaction or executed by eval().

        • OutputResource and DataExporter component difference:
          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.

        Show
        Adnan Durrani added a comment - Fact: Any window.open() call will be caught by the popup blocker which has been made without user interaction or executed by eval(). OutputResource and DataExporter component difference: 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.
        Hide
        Adnan Durrani added a comment -

        New attribute added named as "popupBlockerLabel".

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-dataExporter.jspx
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-dataExporter.jspx
        Completed: At revision: 19317

        Show
        Adnan Durrani added a comment - New attribute added named as "popupBlockerLabel". Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-dataExporter.jspx Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-dataExporter.jspx Completed: At revision: 19317
        Hide
        Joanne Bai added a comment -

        Tested on 1.8.2 build 6 + tomcat 6 using component showcase facelets-enh.

        1. In Opera 10, Safari 4, and FF3.5, if the pop up blocker is on, the message "Popup Blocker detected - click here to resume download..." will show and resume the downloading successfully

        2. in IE6, downloading will proceed regardless of the status of the pop up blocker

        3. In IE7, downloading would not start unless the Ctrl key is held down at the same time. This happens regardless of the status of the pop up blocker as well.

        Show
        Joanne Bai added a comment - Tested on 1.8.2 build 6 + tomcat 6 using component showcase facelets-enh. 1. In Opera 10, Safari 4, and FF3.5, if the pop up blocker is on, the message "Popup Blocker detected - click here to resume download..." will show and resume the downloading successfully 2. in IE6, downloading will proceed regardless of the status of the pop up blocker 3. In IE7, downloading would not start unless the Ctrl key is held down at the same time. This happens regardless of the status of the pop up blocker as well.
        Hide
        Joanne Bai added a comment -

        Tld doc is verified having been updated in 1.8.2 build 6

        Show
        Joanne Bai added a comment - Tld doc is verified having been updated in 1.8.2 build 6
        Hide
        Adnan Durrani added a comment -

        Applied Ken's suggestion to handle IE6 and IE7.

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
        Completed: At revision: 19319

        Show
        Adnan Durrani added a comment - Applied Ken's suggestion to handle IE6 and IE7. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Completed: At revision: 19319

          People

          • Assignee:
            Adnan Durrani
            Reporter:
            Ken Fyten
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: