Class SheetRenderer


  • public class SheetRenderer
    extends org.primefaces.renderkit.CoreRenderer
    The Sheet renderer.
    Since:
    6.2
    Author:
    Mark Lassiter / Melloware
    • Field Summary

      • Fields inherited from class javax.faces.render.Renderer

        PASSTHROUGH_RENDERER_LOCALNAME_KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      SheetRenderer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void decode​(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
      Overrides decode and to parse the request parameters for the two hidden input fields: clientid_input: any new changes provided by the user clientid_selection: the user's cell selections These are JSON values and are parsed into our submitted values data on the Sheet component.
      protected void decodeBehaviors​(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
      Decodes client behaviors (ajax events).
      protected void decodeFilters​(Sheet sheet, java.util.Map<java.lang.String,​java.lang.String> params, java.lang.String clientId)
      Decodes the filter values
      protected void encodeColHeaders​(Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encode the column headers
      protected void encodeColOptions​(Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encode the column options
      protected void encodeData​(javax.faces.context.FacesContext context, Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encode the row data.
      void encodeEnd​(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
      Encodes the Sheet component
      protected void encodeFilterValues​(javax.faces.context.ResponseWriter responseWriter, Sheet sheet, java.lang.String clientId)
      Encodes the filter values.
      protected void encodeFilterVar​(Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encodes a javascript filter var that informs the col header event of the column's filtering options.
      protected void encodeInvalidData​(Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encodes the necessary JS to render invalid data.
      protected void encodeKeyboardTrap​(javax.faces.context.FacesContext context, Sheet sheet)
      Hidden accessible keyboard trap for getting focus.
      protected void encodeMarkup​(javax.faces.context.FacesContext context, Sheet sheet, javax.faces.context.ResponseWriter responseWriter)
      Encodes the HTML markup for the sheet.
      protected void encodeOptionalAttr​(org.primefaces.util.WidgetBuilder wb, java.lang.String attrName, java.lang.String value)
      Encodes an optional attribute to the widget builder specified.
      protected void encodeOptionalNativeAttr​(org.primefaces.util.WidgetBuilder wb, java.lang.String attrName, java.lang.Object value)
      Encodes an optional native attribute (unquoted).
      protected JavascriptVarBuilder encodeRow​(javax.faces.context.FacesContext context, java.lang.String rowKey, JavascriptVarBuilder jsData, JavascriptVarBuilder jsRowStyle, JavascriptVarBuilder jsStyle, JavascriptVarBuilder jsReadOnly, Sheet sheet, int rowIndex)
      Encode a single row.
      protected void encodeScript​(javax.faces.context.FacesContext context, Sheet sheet)
      Encodes the Javascript for the sheet.
      protected void encodeSortVar​(Sheet sheet, org.primefaces.util.WidgetBuilder wb)
      Encodes a javascript sort var that informs the col header event of the column's sorting options.
      boolean getRendersChildren()
      We render the columns (the children).
      • Methods inherited from class org.primefaces.renderkit.CoreRenderer

        buildAjaxRequest, buildAjaxRequest, buildAjaxRequest, buildDomEvent, buildNonAjaxRequest, buildNonAjaxRequest, encodeClientBehaviors, encodeIndexedId, endsWithLenghtUnit, getEventBehaviors, getHighlighter, getIconOnlyButtonText, getResourceRequestPath, getResourceURL, getStyleBuilder, getStyleClassBuilder, getWidgetBuilder, isGrouped, isValueBlank, logDevelopmentWarning, preConfiguredAjaxRequestBuilder, preConfiguredAjaxRequestBuilder, renderAttribute, renderButtonValue, renderChild, renderChildren, renderDomEvent, renderDomEvents, renderDummyMarkup, renderDynamicPassThruAttributes, renderHiddenInput, renderOnchange, renderOnclick, renderPassThruAttributes, renderPassThruAttributes, renderPassThruAttributes, renderValidationMetadata, shouldRenderAttribute, shouldWriteId
      • Methods inherited from class javax.faces.render.Renderer

        convertClientId, encodeBegin, encodeChildren, getConvertedValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SheetRenderer

        public SheetRenderer()
    • Method Detail

      • encodeEnd

        public void encodeEnd​(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component)
                       throws java.io.IOException
        Encodes the Sheet component
        Overrides:
        encodeEnd in class javax.faces.render.Renderer
        Throws:
        java.io.IOException
      • encodeMarkup

        protected void encodeMarkup​(javax.faces.context.FacesContext context,
                                    Sheet sheet,
                                    javax.faces.context.ResponseWriter responseWriter)
                             throws java.io.IOException
        Encodes the HTML markup for the sheet.
        Throws:
        java.io.IOException
      • encodeOptionalAttr

        protected void encodeOptionalAttr​(org.primefaces.util.WidgetBuilder wb,
                                          java.lang.String attrName,
                                          java.lang.String value)
                                   throws java.io.IOException
        Encodes an optional attribute to the widget builder specified.
        Parameters:
        wb - the WidgetBuilder to append to
        attrName - the attribute name
        value - the value
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeOptionalNativeAttr

        protected void encodeOptionalNativeAttr​(org.primefaces.util.WidgetBuilder wb,
                                                java.lang.String attrName,
                                                java.lang.Object value)
                                         throws java.io.IOException
        Encodes an optional native attribute (unquoted).
        Parameters:
        wb - the WidgetBuilder to append to
        attrName - the attribute name
        value - the value
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeScript

        protected void encodeScript​(javax.faces.context.FacesContext context,
                                    Sheet sheet)
                             throws java.io.IOException
        Encodes the Javascript for the sheet.
        Parameters:
        context - the FacesContext
        sheet - the Sheet
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeInvalidData

        protected void encodeInvalidData​(Sheet sheet,
                                         org.primefaces.util.WidgetBuilder wb)
                                  throws java.io.IOException
        Encodes the necessary JS to render invalid data.
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeColHeaders

        protected void encodeColHeaders​(Sheet sheet,
                                        org.primefaces.util.WidgetBuilder wb)
                                 throws java.io.IOException
        Encode the column headers
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeColOptions

        protected void encodeColOptions​(Sheet sheet,
                                        org.primefaces.util.WidgetBuilder wb)
                                 throws java.io.IOException
        Encode the column options
        Throws:
        java.io.IOException - if any IO error occurs
      • encodeData

        protected void encodeData​(javax.faces.context.FacesContext context,
                                  Sheet sheet,
                                  org.primefaces.util.WidgetBuilder wb)
                           throws java.io.IOException
        Encode the row data. Builds row data, style data and read only object.
        Throws:
        java.io.IOException
      • encodeKeyboardTrap

        protected void encodeKeyboardTrap​(javax.faces.context.FacesContext context,
                                          Sheet sheet)
                                   throws java.io.IOException
        Hidden accessible keyboard trap for getting focus.
        Parameters:
        context - the Faces context
        sheet - the Sheet widget
        Throws:
        java.io.IOException - if any IO error occurs
        See Also:
        GitHub 741
      • encodeFilterValues

        protected void encodeFilterValues​(javax.faces.context.ResponseWriter responseWriter,
                                          Sheet sheet,
                                          java.lang.String clientId)
                                   throws java.io.IOException
        Encodes the filter values.
        Throws:
        java.io.IOException
      • encodeFilterVar

        protected void encodeFilterVar​(Sheet sheet,
                                       org.primefaces.util.WidgetBuilder wb)
                                throws java.io.IOException
        Encodes a javascript filter var that informs the col header event of the column's filtering options. The var is an array in the form: ["false","true",["option 1", "option 2"]] False indicates no filtering for the column. True indicates simple input text filter. Array of values indicates a drop down filter with the listed options.
        Throws:
        java.io.IOException
      • encodeSortVar

        protected void encodeSortVar​(Sheet sheet,
                                     org.primefaces.util.WidgetBuilder wb)
                              throws java.io.IOException
        Encodes a javascript sort var that informs the col header event of the column's sorting options. The var is an array of boolean indicating whether or not the column is sortable.
        Throws:
        java.io.IOException
      • decode

        public void decode​(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
        Overrides decode and to parse the request parameters for the two hidden input fields:
        • clientid_input: any new changes provided by the user
        • clientid_selection: the user's cell selections
        These are JSON values and are parsed into our submitted values data on the Sheet component.
        Overrides:
        decode in class javax.faces.render.Renderer
      • decodeFilters

        protected void decodeFilters​(Sheet sheet,
                                     java.util.Map<java.lang.String,​java.lang.String> params,
                                     java.lang.String clientId)
        Decodes the filter values
      • decodeBehaviors

        protected void decodeBehaviors​(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent component)
        Decodes client behaviors (ajax events).
        Overrides:
        decodeBehaviors in class org.primefaces.renderkit.CoreRenderer
        Parameters:
        context - the FacesContext
        component - the Component being decodes
      • getRendersChildren

        public boolean getRendersChildren()
        We render the columns (the children).
        Overrides:
        getRendersChildren in class javax.faces.render.Renderer