Java Code Examples for javax.faces.component.UIComponent.pushComponentToEL()

The following are Jave code examples for showing how to use pushComponentToEL() of the javax.faces.component.UIComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: myfaces-trinidad   File: UIXComponent.java   Source Code and License Vote up 5 votes
/**
 * Broadcast the FacesEvent after updating the current component and
 * current composite component
 * 
 * @param context The current instance of FacesContext
 * @param event The FacesEvent to be broadcasted
 */
public static void broadcastInContext(FacesContext context, FacesEvent event)
{
  UIComponent component = event.getComponent();
  UIComponent compositeParent = null;
  RequestContext requestContext = RequestContext.getCurrentInstance();
  if (!UIComponent.isCompositeComponent(component))
  {
    compositeParent = UIComponent.getCompositeComponentParent(component);
    if (compositeParent != null) 
    {
      requestContext.pushCurrentComponent(context, compositeParent);
      compositeParent.pushComponentToEL(context, null);
    }
  }
  requestContext.pushCurrentComponent(context, component);
  component.pushComponentToEL(context, null);
  try
  {
    component.broadcast(event);
  }
  finally
  {
    component.popComponentFromEL(context);
    requestContext.popCurrentComponent(context, component);
    if (compositeParent != null) 
    {
      compositeParent.popComponentFromEL(context);
      requestContext.popCurrentComponent(context, compositeParent);
    }
  }
}