Description
Actually we have the following methods to render behaviorized attributes on HtmlRendererUtils:
public static boolean renderBehaviorizedAttribute(
FacesContext facesContext, ResponseWriter writer,
UIComponent component, Map<String, List<ClientBehavior>> clientBehaviors, String eventName, String componentProperty,
String htmlAttrName) throws IOException
public static void renderBehaviorizedEventHandlers(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
public static void renderBehaviorizedEventHandlersWithoutOnclick(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
public static void renderBehaviorizedFieldEventHandlers(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
public static void renderBehaviorizedFieldEventHandlersWithoutOnchange(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
public static void renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
public static boolean renderBehaviorizedOnchangeEventHandler(
FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent,
Map<String, List<ClientBehavior>> clientBehaviors) throws IOException
The problem can be seen when we tried to enhance tomahawk, rendering behaviorized attributes (TOMAHAWK-1474). We are starting to have a lot of methods everywhere that does not fall in the base case but do some "hack" to make some attribute work. So, we start to have duplicate code everywhere.
We need to think in a more simple, better documented api for render behaviorized attributes. I don't like to change method signatures of existing methods but I think we need to do it in this case.