You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2009/04/10 23:52:15 UTC
[jira] Commented: (TAP5-640) DOM manipulation no longer allowed
during rendering
[ https://issues.apache.org/jira/browse/TAP5-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697992#action_12697992 ]
Howard M. Lewis Ship commented on TAP5-640:
-------------------------------------------
Obviously, this is related to the work to "de-collection" Element. The changes really shouldn't have been visible to the outside world. A real working test would help a lot in terms of tracking down what's happening.
> DOM manipulation no longer allowed during rendering
> ---------------------------------------------------
>
> Key: TAP5-640
> URL: https://issues.apache.org/jira/browse/TAP5-640
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.1.0.2
> Reporter: Dan Adams
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.