}
private void encodeStyle(RendererState state) throws IOException {
FacesContext context = state.getContext();
ResponseWriter writer = context.getResponseWriter();
UIDataTableBase table = state.getRow();
PartialViewContext pvc = context.getPartialViewContext();
if (!pvc.isAjaxRequest()) {
writer.startElement("style", table);
writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/css", null);
writer.writeText(getCSSText(context, table), null);
writer.endElement("style");
} else {
writer.startElement(HtmlConstants.SCRIPT_ELEM, table);
writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.TEXT_JAVASCRIPT_TYPE, null);
String cssText = getCSSText(context, table);
JSFunction function = new JSFunction("RichFaces.utils.addCSSText", cssText, table.getClientId(context) + ":st");
writer.writeText(function.toScript(), null);
writer.endElement(HtmlConstants.SCRIPT_ELEM);
}