Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2743

Organize renderBehaviorizedXXX method parameters and add new ones

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1
    • JSR-314
    • None

    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.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: