public static void renderAttributeAndBehaviors(FacesContext facesContext, UIComponent component, ComponentAttribute componentAttribute) throws IOException { Object attributeValue = getAttributeAndBehaviorsValue(facesContext, component, componentAttribute); renderAttribute(facesContext, componentAttribute.getHtmlAttributeName(), attributeValue); }
public static void renderAttributeAndBehaviors(FacesContext facesContext, UIComponent component, ComponentAttribute componentAttribute) throws IOException { Object attributeValue = getAttributeAndBehaviorsValue(facesContext, component, componentAttribute); renderAttribute(facesContext, componentAttribute.getHtmlAttributeName(), attributeValue); }
public static void renderAttributeAndBehaviors(FacesContext facesContext, UIComponent component, ComponentAttribute componentAttribute) throws IOException { Object attributeValue = getAttributeAndBehaviorsValue(facesContext, component, componentAttribute); renderAttribute(facesContext, componentAttribute.getHtmlAttributeName(), attributeValue); }
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { String savedTableState = (String) component.getAttributes().get("tableState"); if (savedTableState != null && ! savedTableState.isEmpty()) { // retrieve table state ExtendedDataTableState tableState = new ExtendedDataTableState(savedTableState); consumeTableState(context, (UIDataTableBase) component, tableState); } Map<String, Object> attributes = component.getAttributes(); writer.startElement(HtmlConstants.DIV_ELEM, component); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), null); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt", (String) attributes.get("styleClass")), null); renderAttribute(context, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style")); }
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { String savedTableState = (String) component.getAttributes().get("tableState"); if (savedTableState != null && ! savedTableState.isEmpty()) { // retrieve table state ExtendedDataTableState tableState = new ExtendedDataTableState(savedTableState); consumeTableState(context, (UIDataTableBase) component, tableState); } Map<String, Object> attributes = component.getAttributes(); writer.startElement(HtmlConstants.DIV_ELEM, component); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), null); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt", (String) attributes.get("styleClass")), null); renderAttribute(context, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style")); }
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { String savedTableState = (String) component.getAttributes().get("tableState"); if (savedTableState != null && ! savedTableState.isEmpty()) { // retrieve table state ExtendedDataTableState tableState = new ExtendedDataTableState(savedTableState); consumeTableState(context, (UIDataTableBase) component, tableState); } Map<String, Object> attributes = component.getAttributes(); writer.startElement(HtmlConstants.DIV_ELEM, component); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), null); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt", (String) attributes.get("styleClass")), null); renderAttribute(context, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style")); }
@Override protected void doEncodeChildren(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException { AbstractDataGrid dataGrid = (AbstractDataGrid) component; writer.startElement(HtmlConstants.TABLE_ELEMENT, dataGrid); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, dataGrid.getClientId(facesContext), null); Map<String, Object> attributes = dataGrid.getAttributes(); String classes = concatClasses("rf-dg", attributes.get(HtmlConstants.STYLE_CLASS_ATTR)); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, classes, null); RenderKitUtils.renderAttribute(facesContext, "style", attributes.get(HtmlConstants.STYLE_ATTRIBUTE)); RenderKitUtils.renderAttribute(facesContext, HtmlConstants.TITLE_ATTRIBUTE, attributes.get(HtmlConstants.TITLE_ATTRIBUTE)); encodeCaption(writer, facesContext, dataGrid); encodeHeader(writer, facesContext, dataGrid, false); encodeFooter(writer, facesContext, dataGrid, false); encodeTBody(writer, facesContext, dataGrid, false); writer.endElement(HtmlConstants.TABLE_ELEMENT); }
@Override protected void doEncodeChildren(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException { AbstractDataGrid dataGrid = (AbstractDataGrid) component; writer.startElement(HtmlConstants.TABLE_ELEMENT, dataGrid); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, dataGrid.getClientId(facesContext), null); Map<String, Object> attributes = dataGrid.getAttributes(); String classes = concatClasses("rf-dg", attributes.get(HtmlConstants.STYLE_CLASS_ATTR)); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, classes, null); RenderKitUtils.renderAttribute(facesContext, "style", attributes.get(HtmlConstants.STYLE_ATTRIBUTE)); RenderKitUtils.renderAttribute(facesContext, HtmlConstants.TITLE_ATTRIBUTE, attributes.get(HtmlConstants.TITLE_ATTRIBUTE)); encodeCaption(writer, facesContext, dataGrid); encodeHeader(writer, facesContext, dataGrid, false); encodeFooter(writer, facesContext, dataGrid, false); encodeTBody(writer, facesContext, dataGrid, false); writer.endElement(HtmlConstants.TABLE_ELEMENT); }
@Override protected void doEncodeChildren(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException { AbstractDataGrid dataGrid = (AbstractDataGrid) component; writer.startElement(HtmlConstants.TABLE_ELEMENT, dataGrid); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, dataGrid.getClientId(facesContext), null); Map<String, Object> attributes = dataGrid.getAttributes(); String classes = concatClasses("rf-dg", attributes.get(HtmlConstants.STYLE_CLASS_ATTR)); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, classes, null); RenderKitUtils.renderAttribute(facesContext, "style", attributes.get(HtmlConstants.STYLE_ATTRIBUTE)); RenderKitUtils.renderAttribute(facesContext, HtmlConstants.TITLE_ATTRIBUTE, attributes.get(HtmlConstants.TITLE_ATTRIBUTE)); encodeCaption(writer, facesContext, dataGrid); encodeHeader(writer, facesContext, dataGrid, false); encodeFooter(writer, facesContext, dataGrid, false); encodeTBody(writer, facesContext, dataGrid, false); writer.endElement(HtmlConstants.TABLE_ELEMENT); }
protected void encodeState(FacesContext facesContext, AbstractAjaxStatus status, StatusState state) throws IOException { Map<String, Object> statusAttributes = status.getAttributes(); UIComponent stateFacet = status.getFacet(state.getFacetName()); String stateText = null; if (stateFacet == null) { stateText = (String) statusAttributes.get(state.getTextAttributeName()); } if (state.isOptional() && stateFacet == null && stateText == null) { return; } ResponseWriter writer = facesContext.getResponseWriter(); writer.startElement(HtmlConstants.SPAN_ELEM, status); String stateStyle = (String) statusAttributes.get(state.getStyleAttributeName()); renderAttribute(facesContext, HtmlConstants.STYLE_ATTRIBUTE, HtmlUtil.concatStyles(stateStyle, state.isInitial() ? null : "display:none")); String stateStyleClass = (String) statusAttributes.get(state.getStyleClassAttributeName()); renderAttribute(facesContext, HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses(state.getDefaultStyleClass(), stateStyleClass)); if (stateFacet != null && stateFacet.isRendered()) { stateFacet.encodeAll(facesContext); } else { if (stateText != null) { writer.writeText(stateText, null); } } writer.endElement(HtmlConstants.SPAN_ELEM); }
protected void encodeState(FacesContext facesContext, AbstractAjaxStatus status, StatusState state) throws IOException { Map<String, Object> statusAttributes = status.getAttributes(); UIComponent stateFacet = status.getFacet(state.getFacetName()); String stateText = null; if (stateFacet == null) { stateText = (String) statusAttributes.get(state.getTextAttributeName()); } if (state.isOptional() && stateFacet == null && stateText == null) { return; } ResponseWriter writer = facesContext.getResponseWriter(); writer.startElement(HtmlConstants.SPAN_ELEM, status); String stateStyle = (String) statusAttributes.get(state.getStyleAttributeName()); renderAttribute(facesContext, HtmlConstants.STYLE_ATTRIBUTE, HtmlUtil.concatStyles(stateStyle, state.isInitial() ? null : "display:none")); String stateStyleClass = (String) statusAttributes.get(state.getStyleClassAttributeName()); renderAttribute(facesContext, HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses(state.getDefaultStyleClass(), stateStyleClass)); if (stateFacet != null && stateFacet.isRendered()) { stateFacet.encodeAll(facesContext); } else { if (stateText != null) { writer.writeText(stateText, null); } } writer.endElement(HtmlConstants.SPAN_ELEM); }
protected void encodeState(FacesContext facesContext, AbstractAjaxStatus status, StatusState state) throws IOException { Map<String, Object> statusAttributes = status.getAttributes(); UIComponent stateFacet = status.getFacet(state.getFacetName()); String stateText = null; if (stateFacet == null) { stateText = (String) statusAttributes.get(state.getTextAttributeName()); } if (state.isOptional() && stateFacet == null && stateText == null) { return; } ResponseWriter writer = facesContext.getResponseWriter(); writer.startElement(HtmlConstants.SPAN_ELEM, status); String stateStyle = (String) statusAttributes.get(state.getStyleAttributeName()); renderAttribute(facesContext, HtmlConstants.STYLE_ATTRIBUTE, HtmlUtil.concatStyles(stateStyle, state.isInitial() ? null : "display:none")); String stateStyleClass = (String) statusAttributes.get(state.getStyleClassAttributeName()); renderAttribute(facesContext, HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses(state.getDefaultStyleClass(), stateStyleClass)); if (stateFacet != null && stateFacet.isRendered()) { stateFacet.encodeAll(facesContext); } else { if (stateText != null) { writer.writeText(stateText, null); } } writer.endElement(HtmlConstants.SPAN_ELEM); }