In my case I want to refresh the component with ID baseTab. It is itself contained if form main and tabView tabs. The absolute reference to the component is main:tabs:baseTab. and this is what I need to refer to for example in update attribute:
<p:commandButton update="main:tabs:baseTab"/>
The problem with such full ID is that it is long and can be easily change when I change something in component hierarchy. The ID baseTab is itself unique so I should be, at least theoretically, able to refer this component direcly. But how I can do that?
What is the syntax to refer the component via unique ID? I’ve tried the following:
- :baseTab
- baseTab
- main:baseTab
- :tabs:baseTab
And none of that was working, each was causing the page error that such component does not exist….
I can see the value in not making this reference depend on the component tree structure.
It should be possible to leverage the component binding for this because
updatecan take a ValueExpression.Define a map in request scope using (for example) a faces-config.xml:
Bind the target to the map:
Reference this control’s client identifier in your button:
The target component will be put into the binding map when the tree is created/restored.
Note that this code is untested.