public void encodeBegin(
FacesContext facesContext, UIComponent uiComponent) throws IOException {
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
UIPopup component = (UIPopup) uiComponent;
final String clientId = component.getClientId(facesContext);
final String contentDivId = clientId + CONTENT_ID_POSTFIX;
//final String left = component.getLeft();
//final String top = component.getTop();
final StringBuilder contentStyle = new StringBuilder();
if (component.getWidth() != null) {
contentStyle.append("width: ");
contentStyle.append(component.getWidth());
contentStyle.append("; ");
}
if (component.getHeight() != null) {
contentStyle.append("height: ");
contentStyle.append(component.getHeight());
contentStyle.append("; ");
}
//contentStyle.append("left: ");
//contentStyle.append(left);
//contentStyle.append("; ");
//contentStyle.append("top: ");
//contentStyle.append(top);
//contentStyle.append("; ");
if (component.isModal()) {
writer.startElement(HtmlConstants.DIV, component);
writer.writeIdAttribute(clientId);
writer.writeClassAttribute();
writer.writeAttribute(HtmlAttributes.ONCLICK, "Tobago.popupBlink('" + clientId + "')", null);
if (ClientProperties.getInstance(facesContext).getUserAgent().isMsie()) {
String bgImage = ResourceManagerUtil.getImageWithPath(facesContext, "image/popupBg.png");
writer.writeAttribute(HtmlAttributes.STYLE, "background: none; "
+ "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
+ bgImage + "', sizingMethod='scale');", false);
}
writer.endElement(HtmlConstants.DIV);
}
if (ClientProperties.getInstance(facesContext).getUserAgent().isMsie()) {
writer.startElement(HtmlConstants.IFRAME, component);
writer.writeIdAttribute(clientId + SUBCOMPONENT_SEP + HtmlConstants.IFRAME);
writer.writeClassAttribute("tobago-popup-iframe tobago-popup-none");
UIPage page = ComponentUtil.findPage(facesContext);
final StringBuilder frameSize = new StringBuilder();
if (component.isModal()) {
// full client area
frameSize.append("width: ");
frameSize.append(page.getWidth());
frameSize.append("; ");
frameSize.append("height: ");