Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.1, 2.3.9, 2.3-next-M6
-
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