Class SheetRenderer
java.lang.Object
javax.faces.render.Renderer
org.primefaces.renderkit.CoreRenderer
org.primefaces.extensions.component.sheet.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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Decodes the filter valuesprotected void
encodeColHeaders
(Sheet sheet, org.primefaces.util.WidgetBuilder wb) Encode the column headersprotected void
encodeColOptions
(Sheet sheet, org.primefaces.util.WidgetBuilder wb) Encode the column optionsprotected 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 componentprotected void
encodeFilterValues
(javax.faces.context.ResponseWriter responseWriter, Sheet sheet, 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, String attrName, String value) Encodes an optional attribute to the widget builder specified.protected void
encodeOptionalNativeAttr
(org.primefaces.util.WidgetBuilder wb, String attrName, Object value) Encodes an optional native attribute (unquoted).protected JavascriptVarBuilder
encodeRow
(javax.faces.context.FacesContext context, 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
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, renderRTLDirection, renderValidationMetadata, shouldRenderAttribute, shouldWriteId
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeBegin, encodeChildren, getConvertedValue
-
Constructor Details
-
SheetRenderer
public SheetRenderer()
-
-
Method Details
-
encodeEnd
public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException Encodes the Sheet component- Overrides:
encodeEnd
in classjavax.faces.render.Renderer
- Throws:
IOException
-
encodeMarkup
protected void encodeMarkup(javax.faces.context.FacesContext context, Sheet sheet, javax.faces.context.ResponseWriter responseWriter) throws IOException Encodes the HTML markup for the sheet.- Throws:
IOException
-
encodeOptionalAttr
protected void encodeOptionalAttr(org.primefaces.util.WidgetBuilder wb, String attrName, String value) throws IOException Encodes an optional attribute to the widget builder specified.- Parameters:
wb
- the WidgetBuilder to append toattrName
- the attribute namevalue
- the value- Throws:
IOException
- if any IO error occurs
-
encodeOptionalNativeAttr
protected void encodeOptionalNativeAttr(org.primefaces.util.WidgetBuilder wb, String attrName, Object value) throws IOException Encodes an optional native attribute (unquoted).- Parameters:
wb
- the WidgetBuilder to append toattrName
- the attribute namevalue
- the value- Throws:
IOException
- if any IO error occurs
-
encodeScript
protected void encodeScript(javax.faces.context.FacesContext context, Sheet sheet) throws IOException Encodes the Javascript for the sheet.- Parameters:
context
- the FacesContextsheet
- the Sheet- Throws:
IOException
- if any IO error occurs
-
encodeInvalidData
protected void encodeInvalidData(Sheet sheet, org.primefaces.util.WidgetBuilder wb) throws IOException Encodes the necessary JS to render invalid data.- Throws:
IOException
- if any IO error occurs
-
encodeColHeaders
protected void encodeColHeaders(Sheet sheet, org.primefaces.util.WidgetBuilder wb) throws IOException Encode the column headers- Throws:
IOException
- if any IO error occurs
-
encodeColOptions
protected void encodeColOptions(Sheet sheet, org.primefaces.util.WidgetBuilder wb) throws IOException Encode the column options- Throws:
IOException
- if any IO error occurs
-
encodeData
protected void encodeData(javax.faces.context.FacesContext context, Sheet sheet, org.primefaces.util.WidgetBuilder wb) throws IOException Encode the row data. Builds row data, style data and read only object.- Throws:
IOException
-
encodeRow
protected JavascriptVarBuilder encodeRow(javax.faces.context.FacesContext context, String rowKey, JavascriptVarBuilder jsData, JavascriptVarBuilder jsRowStyle, JavascriptVarBuilder jsStyle, JavascriptVarBuilder jsReadOnly, Sheet sheet, int rowIndex) Encode a single row.- Returns:
- the JSON row
-
encodeKeyboardTrap
protected void encodeKeyboardTrap(javax.faces.context.FacesContext context, Sheet sheet) throws IOException Hidden accessible keyboard trap for getting focus.- Parameters:
context
- the Faces contextsheet
- the Sheet widget- Throws:
IOException
- if any IO error occurs- See Also:
-
encodeFilterValues
protected void encodeFilterValues(javax.faces.context.ResponseWriter responseWriter, Sheet sheet, String clientId) throws IOException Encodes the filter values.- Throws:
IOException
-
encodeFilterVar
protected void encodeFilterVar(Sheet sheet, org.primefaces.util.WidgetBuilder wb) throws 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:
IOException
-
encodeSortVar
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:
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
- Overrides:
decode
in classjavax.faces.render.Renderer
-
decodeFilters
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 classorg.primefaces.renderkit.CoreRenderer
- Parameters:
context
- the FacesContextcomponent
- the Component being decodes
-
getRendersChildren
public boolean getRendersChildren()We render the columns (the children).- Overrides:
getRendersChildren
in classjavax.faces.render.Renderer
-