MyFaces Core
  1. MyFaces Core
  2. MYFACES-2743

Organize renderBehaviorizedXXX method parameters and add new ones

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.1
    • Component/s: JSR-314
    • Labels:
      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.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development