I'm working on an existing JSF component where the encodeEnd
method ends with:
// popComponentFromEL(context);
The Javadoc for UIComponent#popComponentFromEL(FacesContext context)
tells me:
Pop the current
UIComponent
from theFacesContext
attributes map so that the previousUIComponent
, if any, becomes the current component.
When and why would you need or want that?
I've found that none of the other components in the same library are using it.
That's the counterpart of
pushComponentToEL()
whose Javadoc explains this more elaborately.Basically, this approach
allows you during the
// ...
process to grabthis
component using#{component}
in EL, orUIComponent#getCurrentComponent()
in a managed bean.One of well known examples is this construct:
where
#{component.valid}
basically refersUIInput#isValid()
.