Package de.xima.fc.gui.component.tagify
Class TagifyRenderer
- java.lang.Object
-
- javax.faces.render.Renderer
-
- org.primefaces.renderkit.CoreRenderer
-
- org.primefaces.renderkit.InputRenderer
-
- de.xima.fc.gui.component.tagify.TagifyRenderer
-
public class TagifyRenderer extends org.primefaces.renderkit.InputRenderer
PrimeFaces component for the Tagify JavaScript component (MIT license): yairEO/tagify- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description TagifyRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.alibaba.fastjson.JSONArray
createTagListJson(javax.faces.context.FacesContext context, Tagify tagify, List<?> tagList)
protected com.alibaba.fastjson.JSONArray
createTagsJson(javax.faces.context.FacesContext context, Tagify tagify)
void
decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
void
encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
protected void
encodeHiddenInput(javax.faces.context.FacesContext context, Tagify tagify, String clientId)
Encodes the hidden input for the JavaScript widget.protected void
encodeMarkup(javax.faces.context.FacesContext context, Tagify tagify)
Creates the HTML markup for the JavaScript widget.protected void
encodeScript(javax.faces.context.FacesContext context, Tagify tagify)
Encodes the custom script attributes for the JavaScript widget.Object
getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object submittedValue)
protected List<String>
parseTagsJson(String[] hInputValues)
-
Methods inherited from class org.primefaces.renderkit.InputRenderer
isDisabled, isReadOnly, renderAccessibilityAttributes, renderAccessibilityAttributes, renderARIACombobox, renderARIAInvalid, renderARIARequired, renderRTLDirection, shouldDecode
-
Methods inherited from class org.primefaces.renderkit.CoreRenderer
buildAjaxRequest, buildAjaxRequest, buildAjaxRequest, buildDomEvent, buildNonAjaxRequest, buildNonAjaxRequest, decodeBehaviors, encodeClientBehaviors, escapeText, getEventBehaviors, getHighlighter, getResourceRequestPath, getResourceURL, getWidgetBuilder, isGrouped, isValueBlank, preConfiguredAjaxRequestBuilder, preConfiguredAjaxRequestBuilder, renderChild, renderChildren, renderDomEvent, renderDomEvents, renderDummyMarkup, renderDynamicPassThruAttributes, renderOnchange, renderOnclick, renderPassThruAttributes, renderPassThruAttributes, renderValidationMetadata, shouldRenderAttribute, shouldWriteId
-
-
-
-
Method Detail
-
encodeEnd
public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
- Overrides:
encodeEnd
in classjavax.faces.render.Renderer
- Throws:
IOException
-
decode
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
- Overrides:
decode
in classjavax.faces.render.Renderer
-
getConvertedValue
public Object getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object submittedValue) throws javax.faces.convert.ConverterException
- Overrides:
getConvertedValue
in classorg.primefaces.renderkit.InputRenderer
- Throws:
javax.faces.convert.ConverterException
-
encodeScript
protected void encodeScript(javax.faces.context.FacesContext context, Tagify tagify) throws IOException
Encodes the custom script attributes for the JavaScript widget.- Parameters:
context
- Current faces context.tagify
- Current tagify component that is processed.- Throws:
IOException
-
encodeMarkup
protected void encodeMarkup(javax.faces.context.FacesContext context, Tagify tagify) throws IOException
Creates the HTML markup for the JavaScript widget.- Parameters:
context
- Current faces context.tagify
- Current tagify component that is processed.- Throws:
IOException
-
createTagListJson
protected com.alibaba.fastjson.JSONArray createTagListJson(javax.faces.context.FacesContext context, Tagify tagify, List<?> tagList)
- Parameters:
context
- Current faces context.tagify
- Current tagify component.tagList
- A list of tags to convert,Tagify.getWhitelist()
,Tagify.getBlacklist()
, orTagify.getInitiallyDisabledTags()
.- Returns:
- The list of tags, converted to a JSON array that can be passed to the JavaScript widget.
-
createTagsJson
protected com.alibaba.fastjson.JSONArray createTagsJson(javax.faces.context.FacesContext context, Tagify tagify)
- Parameters:
context
- Current faces context.tagify
- Current tagify component.- Returns:
- The JSON array with the data for each individual tag. This is used to pass the tag data to the JavaScript widget.
-
encodeHiddenInput
protected void encodeHiddenInput(javax.faces.context.FacesContext context, Tagify tagify, String clientId) throws IOException
Encodes the hidden input for the JavaScript widget. This is the input element that is passed to tagify during initialization.- Parameters:
context
- Current faces context.tagify
- Current tagify component that is processed.clientId
- Client ID of the current component that is processed.- Throws:
IOException
-
-