ICEfaces
  1. ICEfaces
  2. ICE-5061

Empty ice:graphicImage URL creates unnecessary views

    Details

      Description

      Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view.

      This is clearly an application level issue, however, since it is relatively common we can add a check for this and if the 'src' attribute is blank or '/' (or null) then the component should do the following:

      1. Log and WARN level message, indicating the source page, the ice:graphicImage component ID (if any), and that the graphicImage 'src' attribute is blank.

      2. Replace the <image> tag in the rendered output for the graphicImage component with text "???". This will be easier to maintain than trying to load a specific image to display in this case. The key thing is that the image tag cannot request the incorrect image, or an unnecessary view will be created.

      Of course, if the 'src' attribute is anything but blank, null, or "/", then we should render as normal.

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case [5007000000A79Zs]
        Tyler Johnson made changes -
        Description Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application which results in a new page being fetched and an additional view being created. The ideal solution would be to display a broken link and log this as a warning. Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view. The ideal solution would be to display a broken link and log this as a warning.
        Ken Fyten made changes -
        Fix Version/s 1.8.3 [ 10211 ]
        Assignee Priority P1
        Description Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view. The ideal solution would be to display a broken link and log this as a warning. Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view. The ideal solution would be to display a broken link and log this as a warning.

        We will need an image to use for "broken link" that will be rendered in this case.
        Assignee Yip Ng [ yip.ng ]
        Hide
        Ken Fyten added a comment -

        Attached an image we can load when the src attribute is blank.

        Show
        Ken Fyten added a comment - Attached an image we can load when the src attribute is blank.
        Ken Fyten made changes -
        Attachment redx.gif [ 12065 ]
        Ken Fyten made changes -
        Attachment redx.gif [ 12065 ]
        Ken Fyten made changes -
        Description Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view. The ideal solution would be to display a broken link and log this as a warning.

        We will need an image to use for "broken link" that will be rendered in this case.
        Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view.

        This is clearly an application level issue, however, since it is relatively common we can add a check for this and if the 'src' attribute is blank or '/' (or null) then the component should do the following:

        1. Log and WARN level message, indicating the source page, the ice:graphicImage component ID (if any), and that the graphicImage 'src' attribute is blank.

        2. Replace the <image> tag in the rendered output for the graphicImage component with text "???". This will be easier to maintain than trying to load a specific image to display in this case. The key thing is that the image tag cannot request the incorrect image, or an unnecessary view will be created.

        Of course, if the 'src' attribute is anything but blank, null, or "/", then we should render as normal.
        Hide
        yip.ng added a comment -

        Can't find the image attachment redx.gif.

        Show
        yip.ng added a comment - Can't find the image attachment redx.gif.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19531 Wed Oct 28 15:09:10 MDT 2009 yip.ng ICE-5061: Changed to output text "???" instead of img tag when image URL is missing.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/ImageRenderer.java
        yip.ng made changes -
        Attachment screenshot-1.png [ 12066 ]
        yip.ng made changes -
        Attachment screenshot-1.png [ 12066 ]
        yip.ng made changes -
        Attachment screenshot-1.png [ 12067 ]
        yip.ng made changes -
        Attachment screenshot-2.png [ 12068 ]
        Hide
        yip.ng added a comment -

        Changed to output text "???". See screenshot-1.

        Also output warning message. See screenshot-2. (But there is no way to know the source page.)

        Show
        yip.ng added a comment - Changed to output text "???". See screenshot-1. Also output warning message. See screenshot-2. (But there is no way to know the source page.)
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-Beta [ 10215 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19734 Thu Nov 19 12:47:49 MST 2009 adnan.durrani Fix related to ICE-5061 (Empty ice:graphicImage URL creates unnecessary views)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/ImageRenderer.java
        Hide
        Adnan Durrani added a comment -

        Causing a regression to ICE-2528.

        Show
        Adnan Durrani added a comment - Causing a regression to ICE-2528 .
        Adnan Durrani made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Adnan Durrani added a comment -

        Previous fix refactored.

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Completed: At revision: 19734

        Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Completed: At revision: 19735

        Show
        Adnan Durrani added a comment - Previous fix refactored. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Completed: At revision: 19734 Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Completed: At revision: 19735
        Adnan Durrani made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-GA [ 10216 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Assignee Yip Ng [ yip.ng ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: