As a workaround up to this point, I have stored a component whose id I know I will need later using ui:param, but this has scaling issues since we now have the possibility of reusing the same name. And it forces us to take an extra step any time we use a component reference somewhere. A similar workaround might be to use css classes and jquery -style selectors, with the same disadvantages.
Code: Select all
<some:component id="someComponentId"/>
<ui:param name="storedSomeComponentId" value=":#{p:component('someComponentId')}"/>
[... Somewhere else, possibly in a p:dataTable]
<p:ajax update="#{storedSomeComponentId}"/>
So I've been considering EL functions to aid with this, like myFunction:findComponent('someComponentId'). At this point, we either define a specific search pattern that is more flexible than the standard findComponent, such as "search at my current level, then search at my parent level, then search my parent's parent level, etc, eventually returning the original value if nothing is found", or implement something that understands a relative path construct. The second seems more useful.
Thoughts?