Class HtmlRendererUtils
- java.lang.Object
-
- org.apache.myfaces.renderkit.html.util.HtmlRendererUtils
-
public final class HtmlRendererUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLEAR_HIDDEN_FIELD_FN_NAME
static String
HIDDEN_COMMANDLINK_FIELD_NAME
static String
NON_SUBMITTED_VALUE_WARNING
static String
SUBMIT_FORM_FN_NAME_JSF2
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
appendClearHiddenCommandFormParamsFunctionCall(StringBuilder buf, String formName)
static void
decodeUIInput(FacesContext facesContext, UIComponent component)
Utility to set the submitted value of the provided component from the data in the current request object.static void
decodeUISelectBoolean(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectBooleanCheckboxstatic void
decodeUISelectMany(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectManyListboxstatic void
decodeUISelectOne(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectManyListboxstatic Converter
findUIOutputConverterFailSafe(FacesContext facesContext, UIComponent uiComponent)
static Converter
findUISelectManyConverterFailsafe(FacesContext facesContext, UIComponent uiComponent)
static Converter
findUISelectManyConverterFailsafe(FacesContext facesContext, UIComponent uiComponent, boolean considerValueType)
static String
getHiddenCommandLinkFieldName(UIComponent form, FacesContext facesContext)
Get the name of the request parameter that holds the id of the link-type component that caused the form to be submitted.static String
getOutcomeTargetHref(FacesContext facesContext, UIOutcomeTarget component)
static Set
getSubmittedOrSelectedValuesAsSet(boolean selectMany, UIComponent uiComponent, FacesContext facesContext, Converter converter)
static List<UIParameter>
getValidUIParameterChildren(FacesContext facesContext, List<UIComponent> children, boolean skipNullValue, boolean skipUnrendered)
Calls getValidUIParameterChildren(facesContext, children, skipNullValue, skipUnrendered, true);static List<UIParameter>
getValidUIParameterChildren(FacesContext facesContext, List<UIComponent> children, boolean skipNullValue, boolean skipUnrendered, boolean skipNullName)
Returns a List of all valid UIParameter children from the given children.static boolean
isDisabled(UIComponent component)
static boolean
isDisabledOrReadOnly(UIComponent component)
static boolean
isHideNoSelectionOption(UIComponent component)
Returns the value of the hideNoSelectionOption attribute of the given UIComponentstatic boolean
isOutputHtml5Doctype(FacesContext context)
Returnstrue
if the view root associated with the given faces context will be rendered with a HTML5 doctype.static boolean
isPartialOrBehaviorSubmit(FacesContext facesContext, String clientId)
static boolean
isReadOnly(UIComponent component)
static Map<String,String>
mapAttachedParamsToStringValues(FacesContext facesContext, UIComponent uiComponent)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, String eventName2, Collection<ClientBehaviorContext.Parameter> eventParameters2, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Map<String,List<ClientBehavior>> clientBehaviors)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, String eventName2, Collection<ClientBehaviorContext.Parameter> eventParameters2, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript)
static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue)
Render an attribute taking into account the passed event, the component property and the passed attribute value for the component property.static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript)
Render an attribute taking into account the passed event, the passed attribute value for the component property.static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Map<String,List<ClientBehavior>> clientBehaviors)
Render an attribute taking into account the passed event and the component property.static boolean
renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName)
Render an attribute taking into account the passed event and the component property.static void
renderBehaviorizedEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedEventHandlersWithoutOnclick(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedEventHandlersWithoutOnmouseoverAndOnmouseout(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedFieldEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedFieldEventHandlersWithoutOnchange(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedFieldEventHandlersWithoutOnchange(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderBehaviorizedFieldEventHandlersWithoutOnfocus(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static boolean
renderBehaviorizedOnchangeEventHandler(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors)
static boolean
renderBehaviorizedOnchangeEventHandler(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors)
static void
renderDisplayValueOnly(FacesContext facesContext, UIInput input)
static void
renderDisplayValueOnlyForSelects(FacesContext facesContext, UIComponent uiComponent)
static void
renderDisplayValueOnlyForSelects(FacesContext facesContext, UIComponent uiComponent, boolean considerValueType)
static void
renderFormSubmitScript(FacesContext facesContext)
static void
renderHiddenCommandFormParams(ResponseWriter writer, Set dummyFormParams)
static void
renderHiddenInputField(ResponseWriter writer, Object name, Object value)
static boolean
renderHTMLAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName)
static boolean
renderHTMLAttribute(ResponseWriter writer, String componentProperty, String attrName, Object value)
static boolean
renderHTMLAttributes(ResponseWriter writer, UIComponent component, String[] attributes)
static boolean
renderHTMLAttributesWithOptionalStartElement(ResponseWriter writer, UIComponent component, String elementName, String[] attributes)
static boolean
renderHTMLAttributeWithOptionalStartElement(ResponseWriter writer, UIComponent component, String elementName, String attrName, Object value, boolean startElementWritten)
static boolean
renderHTMLStringAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName)
Renders a html string type attribute.static boolean
renderHTMLStringAttribute(ResponseWriter writer, String componentProperty, String htmlAttrName, String value)
Renders a html string type attribute.static boolean
renderHTMLStringNoStyleAttributes(ResponseWriter writer, UIComponent component, String[] attributes)
static boolean
renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName)
Renders a html string type attribute.static boolean
renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer, String componentProperty, String htmlAttrName, String value)
Renders a html string type attribute.static void
renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem item, boolean disabled)
Renders a label HTML elementstatic void
renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem item, boolean disabled, boolean selected)
Renders a label HTML elementstatic void
renderListbox(FacesContext facesContext, UISelectMany selectMany, boolean disabled, int size, Converter converter)
static void
renderListbox(FacesContext facesContext, UISelectOne selectOne, boolean disabled, int size, Converter converter)
static void
renderMenu(FacesContext facesContext, UISelectMany selectMany, boolean disabled, Converter converter)
static void
renderMenu(FacesContext facesContext, UISelectOne selectOne, boolean disabled, Converter converter)
static boolean
renderOptionalEndElement(ResponseWriter writer, UIComponent component, String elementName, String[] attributes)
static void
renderScriptType(FacesContext context, ResponseWriter writer)
If HTML5 doctype do not render the "type='text/javascript`" attribute as its not necessary.static void
renderSelectOptions(FacesContext context, UIComponent component, Converter converter, Set lookupSet, List selectItemList)
Renders the select options for aUIComponent
that is rendered as an HTML select element.static void
renderTableCaption(FacesContext context, ResponseWriter writer, UIComponent component)
static void
renderUnhandledFacesMessages(FacesContext facesContext)
Renders all FacesMessages which have not been rendered yet with the help of a HtmlMessages component.static void
writeId(ResponseWriter writer, UIComponent component, FacesContext facesContext)
static void
writeIdAndName(ResponseWriter writer, UIComponent component, FacesContext facesContext)
static void
writeIdAndNameIfNecessary(ResponseWriter writer, UIComponent component, FacesContext facesContext)
static void
writeIdIfNecessary(ResponseWriter writer, UIComponent component, FacesContext facesContext)
-
-
-
Field Detail
-
HIDDEN_COMMANDLINK_FIELD_NAME
public static final String HIDDEN_COMMANDLINK_FIELD_NAME
- See Also:
- Constant Field Values
-
CLEAR_HIDDEN_FIELD_FN_NAME
public static final String CLEAR_HIDDEN_FIELD_FN_NAME
- See Also:
- Constant Field Values
-
SUBMIT_FORM_FN_NAME_JSF2
public static final String SUBMIT_FORM_FN_NAME_JSF2
- See Also:
- Constant Field Values
-
NON_SUBMITTED_VALUE_WARNING
public static final String NON_SUBMITTED_VALUE_WARNING
- See Also:
- Constant Field Values
-
-
Method Detail
-
decodeUIInput
public static void decodeUIInput(FacesContext facesContext, UIComponent component)
Utility to set the submitted value of the provided component from the data in the current request object.Param component is required to be an EditableValueHolder. On return from this method, the component's submittedValue property will be set if the submitted form contained that component.
-
decodeUISelectBoolean
public static void decodeUISelectBoolean(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectBooleanCheckbox- Parameters:
facesContext
-component
-
-
isDisabledOrReadOnly
public static boolean isDisabledOrReadOnly(UIComponent component)
-
isDisabled
public static boolean isDisabled(UIComponent component)
-
isReadOnly
public static boolean isReadOnly(UIComponent component)
-
decodeUISelectMany
public static void decodeUISelectMany(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectManyListbox- Parameters:
facesContext
-component
-
-
decodeUISelectOne
public static void decodeUISelectOne(FacesContext facesContext, UIComponent component)
X-CHECKED: tlddoc h:selectManyListbox- Parameters:
facesContext
-component
-
-
renderListbox
public static void renderListbox(FacesContext facesContext, UISelectOne selectOne, boolean disabled, int size, Converter converter) throws IOException
- Throws:
IOException
-
renderListbox
public static void renderListbox(FacesContext facesContext, UISelectMany selectMany, boolean disabled, int size, Converter converter) throws IOException
- Throws:
IOException
-
renderMenu
public static void renderMenu(FacesContext facesContext, UISelectOne selectOne, boolean disabled, Converter converter) throws IOException
- Throws:
IOException
-
renderMenu
public static void renderMenu(FacesContext facesContext, UISelectMany selectMany, boolean disabled, Converter converter) throws IOException
- Throws:
IOException
-
getSubmittedOrSelectedValuesAsSet
public static Set getSubmittedOrSelectedValuesAsSet(boolean selectMany, UIComponent uiComponent, FacesContext facesContext, Converter converter)
-
findUISelectManyConverterFailsafe
public static Converter findUISelectManyConverterFailsafe(FacesContext facesContext, UIComponent uiComponent)
-
findUISelectManyConverterFailsafe
public static Converter findUISelectManyConverterFailsafe(FacesContext facesContext, UIComponent uiComponent, boolean considerValueType)
-
findUIOutputConverterFailSafe
public static Converter findUIOutputConverterFailSafe(FacesContext facesContext, UIComponent uiComponent)
-
renderSelectOptions
public static void renderSelectOptions(FacesContext context, UIComponent component, Converter converter, Set lookupSet, List selectItemList) throws IOException
Renders the select options for aUIComponent
that is rendered as an HTML select element.- Parameters:
context
- the currentFacesContext
.component
- theUIComponent
whose options need to be rendered.converter
-component
's converterlookupSet
- theSet
to use to look up selected optionsselectItemList
- theList
ofSelectItem
s to be rendered as HTML option elements.- Throws:
IOException
-
renderHTMLAttribute
public static boolean renderHTMLAttribute(ResponseWriter writer, String componentProperty, String attrName, Object value) throws IOException
- Returns:
- true, if the attribute was written
- Throws:
IOException
-
renderHTMLAttribute
public static boolean renderHTMLAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName) throws IOException
- Returns:
- true, if the attribute was written
- Throws:
IOException
-
renderHTMLAttributes
public static boolean renderHTMLAttributes(ResponseWriter writer, UIComponent component, String[] attributes) throws IOException
- Returns:
- true, if an attribute was written
- Throws:
IOException
-
renderHTMLAttributeWithOptionalStartElement
public static boolean renderHTMLAttributeWithOptionalStartElement(ResponseWriter writer, UIComponent component, String elementName, String attrName, Object value, boolean startElementWritten) throws IOException
- Throws:
IOException
-
renderHTMLAttributesWithOptionalStartElement
public static boolean renderHTMLAttributesWithOptionalStartElement(ResponseWriter writer, UIComponent component, String elementName, String[] attributes) throws IOException
- Throws:
IOException
-
renderOptionalEndElement
public static boolean renderOptionalEndElement(ResponseWriter writer, UIComponent component, String elementName, String[] attributes) throws IOException
- Throws:
IOException
-
writeId
public static void writeId(ResponseWriter writer, UIComponent component, FacesContext facesContext) throws IOException
- Throws:
IOException
-
writeIdIfNecessary
public static void writeIdIfNecessary(ResponseWriter writer, UIComponent component, FacesContext facesContext) throws IOException
- Throws:
IOException
-
writeIdAndNameIfNecessary
public static void writeIdAndNameIfNecessary(ResponseWriter writer, UIComponent component, FacesContext facesContext) throws IOException
- Throws:
IOException
-
renderHTMLStringPreserveEmptyAttribute
public static final boolean renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName) throws IOException
Renders a html string type attribute. If the value retrieved from the component property is "", the attribute is rendered.- Parameters:
writer
-component
-componentProperty
-htmlAttrName
-- Returns:
- Throws:
IOException
-
renderHTMLStringPreserveEmptyAttribute
public static boolean renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer, String componentProperty, String htmlAttrName, String value) throws IOException
Renders a html string type attribute. If the value retrieved from the component property is "", the attribute is rendered.- Parameters:
writer
-componentProperty
-htmlAttrName
-- Returns:
- Throws:
IOException
-
renderHTMLStringAttribute
public static boolean renderHTMLStringAttribute(ResponseWriter writer, UIComponent component, String componentProperty, String htmlAttrName) throws IOException
Renders a html string type attribute. If the value retrieved from the component property is "" or null, the attribute is not rendered.- Parameters:
writer
-component
-componentProperty
-htmlAttrName
-- Returns:
- Throws:
IOException
-
renderHTMLStringAttribute
public static boolean renderHTMLStringAttribute(ResponseWriter writer, String componentProperty, String htmlAttrName, String value) throws IOException
Renders a html string type attribute. If the value retrieved from the component property is "" or null, the attribute is not rendered.- Parameters:
writer
-componentProperty
-htmlAttrName
-value
-- Returns:
- Throws:
IOException
-
renderHTMLStringNoStyleAttributes
public static boolean renderHTMLStringNoStyleAttributes(ResponseWriter writer, UIComponent component, String[] attributes) throws IOException
- Throws:
IOException
-
writeIdAndName
public static void writeIdAndName(ResponseWriter writer, UIComponent component, FacesContext facesContext) throws IOException
- Throws:
IOException
-
renderDisplayValueOnlyForSelects
public static void renderDisplayValueOnlyForSelects(FacesContext facesContext, UIComponent uiComponent) throws IOException
- Throws:
IOException
-
renderDisplayValueOnlyForSelects
public static void renderDisplayValueOnlyForSelects(FacesContext facesContext, UIComponent uiComponent, boolean considerValueType) throws IOException
- Throws:
IOException
-
renderTableCaption
public static void renderTableCaption(FacesContext context, ResponseWriter writer, UIComponent component) throws IOException
- Throws:
IOException
-
renderDisplayValueOnly
public static void renderDisplayValueOnly(FacesContext facesContext, UIInput input) throws IOException
- Throws:
IOException
-
appendClearHiddenCommandFormParamsFunctionCall
public static void appendClearHiddenCommandFormParamsFunctionCall(StringBuilder buf, String formName)
-
renderFormSubmitScript
public static void renderFormSubmitScript(FacesContext facesContext) throws IOException
- Throws:
IOException
-
renderHiddenCommandFormParams
public static void renderHiddenCommandFormParams(ResponseWriter writer, Set dummyFormParams) throws IOException
- Throws:
IOException
-
renderHiddenInputField
public static void renderHiddenInputField(ResponseWriter writer, Object name, Object value) throws IOException
- Throws:
IOException
-
renderLabel
public static void renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem item, boolean disabled) throws IOException
Renders a label HTML element- Throws:
IOException
-
renderLabel
public static void renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem item, boolean disabled, boolean selected) throws IOException
Renders a label HTML element- Throws:
IOException
-
getHiddenCommandLinkFieldName
public static String getHiddenCommandLinkFieldName(UIComponent form, FacesContext facesContext)
Get the name of the request parameter that holds the id of the link-type component that caused the form to be submitted.Within each page there may be multiple "link" type components that cause page submission. On the server it is necessary to know which of these actually caused the submit, in order to invoke the correct listeners. Such components therefore store their id into the "hidden command link field" in their associated form before submitting it.
The field is always a direct child of each form, and has the same name in each form. The id of the form component is therefore both necessary and sufficient to determine the full name of the field.
-
isPartialOrBehaviorSubmit
public static boolean isPartialOrBehaviorSubmit(FacesContext facesContext, String clientId)
-
getOutcomeTargetHref
public static String getOutcomeTargetHref(FacesContext facesContext, UIOutcomeTarget component) throws IOException
- Throws:
IOException
-
mapAttachedParamsToStringValues
public static Map<String,String> mapAttachedParamsToStringValues(FacesContext facesContext, UIComponent uiComponent)
-
getValidUIParameterChildren
public static List<UIParameter> getValidUIParameterChildren(FacesContext facesContext, List<UIComponent> children, boolean skipNullValue, boolean skipUnrendered)
Calls getValidUIParameterChildren(facesContext, children, skipNullValue, skipUnrendered, true);- Parameters:
facesContext
-children
-skipNullValue
-skipUnrendered
-- Returns:
- ArrayList size > 0 if any parameter found
-
getValidUIParameterChildren
public static List<UIParameter> getValidUIParameterChildren(FacesContext facesContext, List<UIComponent> children, boolean skipNullValue, boolean skipUnrendered, boolean skipNullName)
Returns a List of all valid UIParameter children from the given children. Valid means that the UIParameter is not disabled, its name is not null (if skipNullName is true), its value is not null (if skipNullValue is true) and it is rendered (if skipUnrendered is true). This method also creates a warning for every UIParameter with a null-name (again, if skipNullName is true) and, if ProjectStage is Development and skipNullValue is true, it informs the user about every null-value.- Parameters:
facesContext
-children
-skipNullValue
- should UIParameters with a null value be skippedskipUnrendered
- should UIParameters with isRendered() returning false be skippedskipNullName
- should UIParameters with a null name be skipped (normally true, but in the case of h:outputFormat false)- Returns:
- ArrayList size > 0 if any parameter found
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
Render an attribute taking into account the passed event and the component property. It will be rendered as "componentProperty" attribute.- Parameters:
facesContext
-writer
-componentProperty
-component
-eventName
-clientBehaviors
-- Returns:
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName) throws IOException
Render an attribute taking into account the passed event and the component property. The event will be rendered on the selected htmlAttrName- Parameters:
facesContext
-writer
-component
-clientBehaviors
-eventName
-componentProperty
-htmlAttrName
-- Returns:
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName) throws IOException
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue) throws IOException
Render an attribute taking into account the passed event, the component property and the passed attribute value for the component property. The event will be rendered on the selected htmlAttrName.- Parameters:
facesContext
-writer
-componentProperty
-component
-eventName
-clientBehaviors
-htmlAttrName
-attributeValue
-- Returns:
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue) throws IOException
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript) throws IOException
Render an attribute taking into account the passed event, the passed attribute value for the component property. and the specific server code. The event will be rendered on the selected htmlAttrName.- Parameters:
facesContext
-writer
-componentProperty
-component
-eventName
-clientBehaviors
-htmlAttrName
-attributeValue
-serverSideScript
-- Returns:
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript) throws IOException
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, String eventName2, Collection<ClientBehaviorContext.Parameter> eventParameters2, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript) throws IOException
- Throws:
IOException
-
renderBehaviorizedAttribute
public static boolean renderBehaviorizedAttribute(FacesContext facesContext, ResponseWriter writer, String componentProperty, UIComponent component, String sourceId, String eventName, Collection<ClientBehaviorContext.Parameter> eventParameters, String eventName2, Collection<ClientBehaviorContext.Parameter> eventParameters2, Map<String,List<ClientBehavior>> clientBehaviors, String htmlAttrName, String attributeValue, String serverSideScript) throws IOException
- Throws:
IOException
-
renderBehaviorizedEventHandlers
public static void renderBehaviorizedEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedEventHandlers
public static void renderBehaviorizedEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedEventHandlersWithoutOnclick
public static void renderBehaviorizedEventHandlersWithoutOnclick(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedEventHandlersWithoutOnmouseoverAndOnmouseout
public static void renderBehaviorizedEventHandlersWithoutOnmouseoverAndOnmouseout(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedFieldEventHandlers
public static void renderBehaviorizedFieldEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedFieldEventHandlersWithoutOnfocus
public static void renderBehaviorizedFieldEventHandlersWithoutOnfocus(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedFieldEventHandlersWithoutOnchange
public static void renderBehaviorizedFieldEventHandlersWithoutOnchange(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedFieldEventHandlersWithoutOnchange
public static void renderBehaviorizedFieldEventHandlersWithoutOnchange(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect
public static void renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedOnchangeEventHandler
public static boolean renderBehaviorizedOnchangeEventHandler(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
renderBehaviorizedOnchangeEventHandler
public static boolean renderBehaviorizedOnchangeEventHandler(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String sourceId, Map<String,List<ClientBehavior>> clientBehaviors) throws IOException
- Throws:
IOException
-
isHideNoSelectionOption
public static boolean isHideNoSelectionOption(UIComponent component)
Returns the value of the hideNoSelectionOption attribute of the given UIComponent- Parameters:
component
-- Returns:
-
renderUnhandledFacesMessages
public static void renderUnhandledFacesMessages(FacesContext facesContext) throws IOException
Renders all FacesMessages which have not been rendered yet with the help of a HtmlMessages component.- Parameters:
facesContext
-- Throws:
IOException
-
isOutputHtml5Doctype
public static boolean isOutputHtml5Doctype(FacesContext context)
Returnstrue
if the view root associated with the given faces context will be rendered with a HTML5 doctype.- Parameters:
context
- Involved faces context.- Returns:
true
if the view root associated with the given faces context will be rendered with a HTML5 doctype.
-
renderScriptType
public static void renderScriptType(FacesContext context, ResponseWriter writer) throws IOException
If HTML5 doctype do not render the "type='text/javascript`" attribute as its not necessary.- Parameters:
context
- Involved faces context.writer
- Involved response writer.- Throws:
IOException
- if any error occurs writing the response.
-
-