Details
Description
As described in ICE-5211, it can be difficult to integrate components that require external scripts, such as
http://maps.google.com/maps/api/js?sensor=false
Evidence indicates that these external scripts must be loaded on initial page GET, so the best solution is to have the script loading as part of the page template.
This can be implemented as an externalScript resource component automatically added to the HEAD resources, similar to bridge.js. The externalScript component should automatically detect any other components in the application that require external scripts. This can be done through a context parameter or an <ice:config> parameter. Additionally, it may be desirable to specify a script link to be loaded directly in web.xml (not associated with any particular component.)
It is possible that <ice:config> will not run at the right time to ensure that the JavaScript is loaded when required.
http://maps.google.com/maps/api/js?sensor=false
Evidence indicates that these external scripts must be loaded on initial page GET, so the best solution is to have the script loading as part of the page template.
This can be implemented as an externalScript resource component automatically added to the HEAD resources, similar to bridge.js. The externalScript component should automatically detect any other components in the application that require external scripts. This can be done through a context parameter or an <ice:config> parameter. Additionally, it may be desirable to specify a script link to be loaded directly in web.xml (not associated with any particular component.)
It is possible that <ice:config> will not run at the right time to ensure that the JavaScript is loaded when required.
Issue Links
- depends on
-
ICE-5211 Gmap doesn't work under compat
-
- Closed
-
Existing implementation was essentially complete but needed a bit of voodoo: for some reason, the lack of an ID on the addComponentResource() component was causing the <head> to be assigned a different ID each time, resulting in a full page update.
Additionally, the script for GMapRenderer required v2 Google Map JavaScript and the init parameter key appended to the URL.