Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Component/s: Framework
-
Labels:None
-
Environment:ICEfaces 2, ACE 2.1
-
Assignee Priority:P2
-
Workaround Exists:Yes
-
Workaround Description:Disable the DOM differencing of this component, or of all partial updates.
Description
Some of the new ACE components use a technique whereby they render a portion of themselves, instead of their full selves. For example, when sorting, the new data table will only render out the table contents, and not the headers and footers. Or, the tabView component, with dynamic="true", cache="true" and a tabChangeListener, will only render the newly visited tab contents, when they have not yet been shown, instead of the whole tabView, since it is caching the other already loaded tab contents.
In org.icefaces.impl.context.DOMPartialRenderCallback.visit(-), around line 458, we find the position of the root of the component, by assuming the component clientId is the id of the root DOM element. We then remove the whole DOM sub-tree corresponding to that component, and setup the DOM cursor so that the component may fully render itself in the vacated space. We then search for the new elements by the clientId, so that we can compare the old sub-tree to the new sub-tree. But if the newly rendered output is not of the whole component, the search for the clientId fails, and we get a NPE.
What needs to be done, is to allow the component to render itself first, adjacent to the old rendering of itself. And then the id of the top-most newly rendered element should be used to find the corresponding old element. If the new top-most element does not have an id, or if it's not found in the old rendering, then the update should just be sent to the browser, without any DOM differencing, and the bridge will deal with it. If the corresponding old element is found, then that old sub-tree may be scraped out, the new sub-tree supplanted in it's place, and the differencing done, so that the optimal change set can be transmitted. In most cases, the top element ids will be the clientId, and it will be the whole component being swapped in, but in special new ACE scenarios, it will be the sub-component regions.
In org.icefaces.impl.context.DOMPartialRenderCallback.visit(-), around line 458, we find the position of the root of the component, by assuming the component clientId is the id of the root DOM element. We then remove the whole DOM sub-tree corresponding to that component, and setup the DOM cursor so that the component may fully render itself in the vacated space. We then search for the new elements by the clientId, so that we can compare the old sub-tree to the new sub-tree. But if the newly rendered output is not of the whole component, the search for the clientId fails, and we get a NPE.
What needs to be done, is to allow the component to render itself first, adjacent to the old rendering of itself. And then the id of the top-most newly rendered element should be used to find the corresponding old element. If the new top-most element does not have an id, or if it's not found in the old rendering, then the update should just be sent to the browser, without any DOM differencing, and the bridge will deal with it. If the corresponding old element is found, then that old sub-tree may be scraped out, the new sub-tree supplanted in it's place, and the differencing done, so that the optimal change set can be transmitted. In most cases, the top element ids will be the clientId, and it will be the whole component being swapped in, but in special new ACE scenarios, it will be the sub-component regions.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Mark Collette
created issue -
Mark Collette
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [] | |
Description |
Some of the new ACE components use a technique whereby they render a portion of themselves, instead of their full selves. For example, when sorting, the new data table will only render out the table contents, and not the headers and footers. Or, the tabView component, with dynamic="true", cache="true" and a tabChangeListener, will only render the newly visited tab contents, when they have not yet been shown, instead of the whole tabView, since it is caching the other already loaded tab contents. In org.icefaces.impl.context.DOMPartialRenderCallback.visit(-), around line 458, we find the position of the root of the component, by assuming the component clientId is the id of the root DOM element. We then remove the whole DOM sub-tree corresponding to that component, and setup the DOM cursor so that the component may fully render itself in the vacated space. We then search for the new elements by the clientId, so that we can compare the old sub-tree to the new sub-tree. But if the newly rendered output is not of the whole component, the search for the clientId fails, and we get a NPE. What needs to be done, is to allow the component to render itself first, adjacent to the old rendering of itself. And then the id of the top-most newly rendered element should be used to find the corresponding old element. If the new top-most elemnet does not have an id, or if it's not found in the old rendering, then the update should just be sent to the browser, without any DOM differencing, and the bridge will deal with it. If the corresponding old element is found, then that old sub-trre may be scraped out, the new sub-tree supplanted in it's place, and the differencing done, so that the optimal change set can be transmitted. In most cases, the top element ids will be the clientId, and it will be the whole component being swapped in, but in special new ACE scenarios, it will be the sub-component regions. |
Some of the new ACE components use a technique whereby they render a portion of themselves, instead of their full selves. For example, when sorting, the new data table will only render out the table contents, and not the headers and footers. Or, the tabView component, with dynamic="true", cache="true" and a tabChangeListener, will only render the newly visited tab contents, when they have not yet been shown, instead of the whole tabView, since it is caching the other already loaded tab contents. In org.icefaces.impl.context.DOMPartialRenderCallback.visit(-), around line 458, we find the position of the root of the component, by assuming the component clientId is the id of the root DOM element. We then remove the whole DOM sub-tree corresponding to that component, and setup the DOM cursor so that the component may fully render itself in the vacated space. We then search for the new elements by the clientId, so that we can compare the old sub-tree to the new sub-tree. But if the newly rendered output is not of the whole component, the search for the clientId fails, and we get a NPE. What needs to be done, is to allow the component to render itself first, adjacent to the old rendering of itself. And then the id of the top-most newly rendered element should be used to find the corresponding old element. If the new top-most element does not have an id, or if it's not found in the old rendering, then the update should just be sent to the browser, without any DOM differencing, and the bridge will deal with it. If the corresponding old element is found, then that old sub-tree may be scraped out, the new sub-tree supplanted in it's place, and the differencing done, so that the optimal change set can be transmitted. In most cases, the top element ids will be the clientId, and it will be the whole component being swapped in, but in special new ACE scenarios, it will be the sub-component regions. |
Mark Collette
made changes -
Salesforce Case | [] | |
Fix Version/s | 2.1 [ 10241 ] |
Mark Collette
made changes -
Link | This issue blocks ICE-7034 [ ICE-7034 ] |
Mark Collette
made changes -
Workaround Description | Disable the DOM differencing of this component, or of all partial updates. | |
Workaround Exists | [Yes] | |
Salesforce Case | [] |
Arturo Zambrano
made changes -
Attachment | accordionPanel.war [ 13521 ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Assignee Priority | P1 | |
Assignee | Ted Goddard [ ted.goddard ] |
Ted Goddard
made changes -
Assignee | Ted Goddard [ ted.goddard ] | Arturo Zambrano [ artzambrano ] |
Carmen Cristurean
made changes -
Attachment | accordionPanel1.war [ 13529 ] |
Carmen Cristurean
made changes -
Attachment | screenshot1.jpg [ 13530 ] | |
Attachment | screenshot2.jpg [ 13531 ] |
Ted Goddard
made changes -
Assignee | Arturo Zambrano [ artzambrano ] | Carmen Cristurean [ ccristurean ] |
Ken Fyten
made changes -
Assignee | Carmen Cristurean [ ccristurean ] | Nils Lundquist [ nils.lundquist ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Assignee Priority | P1 | P2 |
Nils Lundquist
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | 2.1-Beta [ 10291 ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Security | Private [ 10001 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |