Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.8.2-EE-Beta, 1.8.2-EE-GA, 1.8.3
-
Component/s: ICE-Components
-
Labels:None
-
Environment:FF, IE
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.
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.
Attached an image we can load when the src attribute is blank.