import javax.faces.context.FacesContext;
import java.io.IOException;
public class ObjectRenderer extends LayoutComponentRendererBase {
public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final UIObject object = (UIObject) component;
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.IFRAME, object);
writer.writeAttribute(HtmlAttributes.FRAMEBORDER, "0", false);
final String clientId = object.getClientId(facesContext);
writer.writeIdAttribute(clientId);
String name = object.getName();
if (name == null) {
name = clientId;
}
writer.writeNameAttribute(name);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, object);
final String src = object.getSrc();
if (src != null) {
writer.writeAttribute(HtmlAttributes.SRC, src, true);
} else {
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getBlankPage(facesContext), false);
}