@Override public void addClientBehavior(String eventName, ClientBehavior clientBehavior) { // If the specified client behavior is an Ajax behavior, then the alloy:accordion component tag // has an f:ajax // child tag. Register a listener that can respond to the Ajax behavior by invoking the // tabCollapseListener or // tabExpandListener that may have been specified. if (clientBehavior instanceof AjaxBehavior) { AjaxBehavior ajaxBehavior = (AjaxBehavior) clientBehavior; ajaxBehavior.addAjaxBehaviorListener(new AccordionBehaviorListener()); } super.addClientBehavior(eventName, clientBehavior); }