Posted by mriem in mriem on Jan 1, 2014 11:53:00 AM
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog
Why would you add a placeholder component to the tree using ui:component? Well, sometimes you need to add content dynamically, but you also need to be able sure where it ends up.
Why would you need to know where it ends up? Well imagine the following scenario
Without the ui:component usage you would not know what the ids of each of the trees of the included content would be as the ids depends on how many subtrees are rendered. E.g. here it could render 3, 2, 1 or 0 subtrees. Which would make it be hard to find any component in those subtrees, but by using the ui:component tag you can use it as a starting point to look for the components in any of the subtrees.
And that is it!