Hi I don't think use underscore could be a good choice, because for generated ids, the prefix is j_id, so methods like UIComponent.findComponent will not work correctly.
I have checked it and it is a bug. It should use UINamingContainer.getSeparatorChar(FacesContext) instead a constant. Please file an issue on myfaces issue tracker here: https://issues.apache.org/jira/browse/MYFACES so it can be fixed regards, Leonardo Uribe 2011/6/15 Christoph Dietze <[email protected]>: > Hello, > > we changed the default SEPARATOR_CHAR from colon to underscore. However, > that causes an Exception > > javax.faces.FacesException: Component with id:myid not found at > org.apache.myfaces.renderkit.html.HtmlAjaxBehaviorRenderer.getComponentId(HtmlAjaxBehaviorRenderer.java:291) > > It looks like org.apache.myfaces.renderkit.html.HtmlAjaxBehaviorRenderer > assumes that the separator char is always a colon. Here is the method > throwing the exception: > > private final String getComponentId(ClientBehaviorContext context, > String id) { > > UIComponent contextComponent = context.getComponent(); > UIComponent target = contextComponent.findComponent(id); > if (target == null) { > target = contextComponent.findComponent(COLON + id); > } > if (target != null) { > return target.getClientId(); > } > throw new FacesException("Component with id:" + id + " not found" > ); > } > > Is this a bug? > > (using myfaces 2.1.1) > > greets, > Christoph > > > > www.ergodirekt.de > www.facebook.com/ergodirekt > www.twitter.com/ergodirekt > > _______________________ > > ERGO Direkt Lebensversicherung AG · Sitz: Fürth > Amtsgericht Fürth HRB 2787 · UST-ID-Nr. DE159593454 > ERGO Direkt Versicherung AG · Sitz: Fürth > Amtsgericht Fürth HRB 2934 · UST-ID-Nr. DE159593438 > ERGO Direkt Krankenversicherung AG · Sitz: Fürth > Amtsgericht Fürth HRB 4694 · UST-ID-Nr. DE159593446 > Vorsitzender der Aufsichtsräte: Dr. Daniel von Borries > Vorstände: Peter M. Endres (Vorsitzender), > Ralf Hartmann, Dr. Jörg Stoffels > Adresse: Karl-Martell-Straße 60 · 90344 Nürnberg · Deutschland

