Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.1.0.2
-
None
Description
We have a number of utilities that do DOM manipulation while the page is rendering. This is often a lot easier than doing it after render and results in more concise code. An example is if you have a list of elements:
<ul>
<li>foo</li>
<li></li>
<li></li>
</ul>
After each LI renders, do something like this:
if (element.getChildren().isEmpty())
element.remove();
It will work for the first empty LI and throw a NPE on the second empty LI because the container inside the element is null (which is odd since it just rendered into a container). But if you wait till after the LIs have all rendered you can loop back and do this safely. However, it's much less readable code and is a real bummer.