http://codereview.appspot.com/65052/diff/1/2 File java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/DefaultTemplateProcessor.java (right):
http://codereview.appspot.com/65052/diff/1/2#newcode446 Line 446: buffer.append("}).apply(e);"); On 2009/05/15 17:47:00, Evan Gilbert (code review) wrote:
Might be easier to add an ID to the original inserted node (or use
existing ID).
Pseudo-code String id = el.getAttribute("id") if (id == null) { id = generateUniqueId(); el.setAttribute(id); } .... buffer.append("}.apply(document.getElementById('" + jsEscape(id) +
"')"); This would indeed be simpler, but would misfire for the edge case where existing IDs are non-unique (which is frowned upon, but possible in HTML). http://codereview.appspot.com/65052