Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 4.0.BETA
-
Fix Version/s: 4.0
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ACE
-
Assignee Priority:P1
Description
With this task, the new ice.ace.instance function from ICE-8475, which will replace widgetVar, will allow for lazy initiated components to be automatically initiated by ice.ace.instance. The idea being that with something like popup panel, which is typically made visible via its widgetVar, it previously had to eagerly initialise so that the widgetVar would be available to make it visible. Now with this alternate means of getting the javascript object reference, we can detect that the object has not yet been initialised, and do so lazily only when ice.ace.instance is called.
Our first step needs to be to take all the components that already use lazy initialise, and integrate that to work with ice.ace.instance, as the switch to lazy init had meant that one couldn't count on accessing their widgetVar.
Our first step needs to be to take all the components that already use lazy initialise, and integrate that to work with ice.ace.instance, as the switch to lazy init had meant that one couldn't count on accessing their widgetVar.
Issue Links
- depends on
-
ICE-8475 Implement client instance look up mechanism for the ace:dataTable
-
- Closed
-
Committed new feature at revision 38540. Modified core.js to initialize lazy init components when calling ice.ace.instance so an object reference can be obtained for lazy init components as well.
The way this was made was by adding a global object ice.ace.lazy.registry to register all lazy init components on the page. They keys of this object are client ids, and the values are functions that call ice.ace.lazy(). So, when calling ice.ace.instance, the registry is checked to see if there's a registered lazy init component. In such case, the component is initialized before returning the object reference. The component is removed from the registry as well.
The only components using ice.ace.lazy at the moment are ace:checkboxButton, ace:linkButton, ace:pushButton, and ace:tableconfigPanel. The first three were adjusted to this change. As for ace:tableconfigPanel, it doesn't expose a client API, so no adjustment was made in this case.
Other components that could now be made lazy init include the following: