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

HtmlTextareaRendererBase, separate "begin tag" code from "end tag"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.1, 2.3.9, 2.3-next-M6
    • 2.3.10, 2.3-next-M7, 3.0.2
    • None
    • None

    Description

      This ticket is very similar to MYFACES-4428 and MYFACES-4430 except it applies to HtmlTextareaRendererBase. 

       

      As with the others, we're trying to implement a few JSF components that extend from the generic JSF components/renderers. This particular component is extending javax.faces.component.html.HtmlTextareaRendererBase.

       

      The problem is HtmlTextareaRendererBase does not have an encodeBegin() method, instead it does all of the "Start tag" encoding in the encodeEnd() method. This makes it impossible to create custom components that wrap the functionality of the default render kit.

       

      I propose adding an encodeBegin() method that still calls renderTextAreaBegin()

      @Override
      public void encodeBegin(FacesContext facesContext, UIComponent uiComponent)
      throws IOException
      {
      RendererUtils.checkParamValidity(facesContext, uiComponent, UIInput.class);
      Map<String, List<ClientBehavior>> behaviors = null;
      if (uiComponent instanceof ClientBehaviorHolder)
      {
      behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
      if (!behaviors.isEmpty())
      { ResourceUtils.renderDefaultJsfJsInlineIfNecessary(facesContext, facesContext.getResponseWriter()); }
      }
      renderTextAreaBegin(facesContext, uiComponent);
      } 

       

      and then leaving renderTextAreaValue() and renderTextAreaEnd() in the encode end

       

      @Override
      public void encodeEnd(FacesContext facesContext, UIComponent uiComponent)
      throws IOException{ 
         renderTextAreaValue(facesContext, uiComponent); 
         renderTextAreaEnd(facesContext, uiComponent); 
      } 

       

      These changes will split the logic of encodeBegin and encodeEnd into separate methods and allow for the creation of custom components.

       
      Im open to any feedback on this proposed change. Thanks!

       

      Thanks

      Attachments

        Activity

          People

            melloware Melloware
            glynn.leininger glynn leininiger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: