* Faces Event instance
*/
public void broadcast(FacesEvent event) throws AbortProcessingException {
FacesContext facesContext = FacesContext.getCurrentInstance();
AjaxContext ajaxContext = AjaxContextImpl
.getCurrentInstance(facesContext);
Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
String clientId = this.getClientId(facesContext);
if (!params.containsKey(clientId)) {
return;
}
if (event instanceof ActionEvent) {
ActionListener listeners[] = getActionListeners();
for (ActionListener l : listeners) {
l.processAction((ActionEvent) event);
}
} else if (event instanceof AjaxEvent) {
if (!params.containsKey(FORCE_PERCENT_PARAM)
&& params.containsKey(PERCENT_PARAM)) {
Number value = getNumber(this.getAttributes().get(
RendererUtils.HTML.value_ATTRIBUTE));
ajaxContext.removeRenderedArea(clientId);
ajaxContext
.setResponseData(getResponseData(value, facesContext));
AjaxRendererUtils.addRegionsFromComponent(this, facesContext);
} else if (params.containsKey(FORCE_PERCENT_PARAM)) {
if (logger.isDebugEnabled()) {
logger.debug("Force state: "
+ this.getClientId(facesContext));
}
ajaxContext.addComponentToAjaxRender(this);
String forcedState = params.get(FORCE_PERCENT_PARAM);
if ("complete".equals(forcedState)) {
Object reRender = this.getAttributes().get("reRenderAfterComplete");
Set<String> ajaxRegions = AjaxRendererUtils.asSet(reRender);
if (ajaxRegions != null) {
for (Iterator<String> iter = ajaxRegions.iterator(); iter
.hasNext();) {
String id = iter.next();
ajaxContext.addComponentToAjaxRender(this, id);
}
}
}
}
}