According to https://code.google.com/p/primefaces/issues/detail?id=4720, The ComponentUtils.resolveWidgetVar(String expression, UIComponent component)
function is available in Primefaces since 2013. It can be used in EL by the "#{p:widgetVarFromContext(searchExpression, component)}"
function.
This is useful in case of several components have the same id in different NamingContainer
, but are still present in the same view. In this case,
the #{p:widgetVar(searchExpression)}
function only returns the last one found.
I don't understand however how to reference the UIComponent
that must be passed as the second argument from EL. The above mentioned bug report suggests we can refer to it using #{component}
. Can anyone provide me with an example?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…