[OmniFaces utilities] The
getCurrentComponent() method returns the current UI component from the EL context.Method:
import
org.omnifaces.util.Components;
...
UIComponent
currentComponent = Components.getCurrentComponent();
This method return
the UIComponent instance
that is currently processing. For example, OmniFaces uses this method to
obtain the current component that causes a constraint violation in the JsfLabelMessageInterpolator (custom message interpolator):
...
if
(hasContext()) {
label
= getLabel(getCurrentComponent());
}
...







JSF 2 Tutorials at www.mkyong.com
JavaServer Faces (JSF) Tutorial 

















Niciun comentariu :
Trimiteți un comentariu