// Prepend an extra slash to avoid re-prepending the context path
contentFrame.setSource("/" + path + "&" + queryString);
}
}
HtmlFrameBorderLayout frameSet = new HtmlFrameBorderLayout();
frameSet.setShortDesc(contentStr); // for accessibility
frameSet.setCenter(contentFrame);
// this border attribute is a "secret" attribute set to fix
// 4339153 DIALOGS IN FIREFOX HAVE WHITE LINE AT THE BOTTOM
frameSet.getAttributes().put("border", Boolean.FALSE);
// see bug 3198336 apss accessibility violations
CoreOutputText alternateContent = new CoreOutputText();
alternateContent.setValue(arc.getTranslatedString("NO_FRAMES_MESSAGE"));
frameSet.setAlternateContent(alternateContent);
// Set the title to the title of the content, and then shrink (or expand)
// the window to fit the content. The 25 pixel fudge factor is purely
// a hack to handle calendarDialog, which regularly needs to grow
// a line or two. A better method that accounts for font heights
// would be good...
// Bug #2464627: Allow support for forcing a minimum size
StringBuilder onload = new StringBuilder(_FRAMESET_ONLOAD_TEXT.length()
// space for the param plus the 'W:'
+ (gotWidth
? widthParam.length() + 2
: 0)
// space for the param plus the 'H:'
+ (gotHeight
? heightParam.length() + 2
: 0)
// space for commas, brackets,
// and closing paren
+ 5);
onload.append(_FRAMESET_ONLOAD_TEXT);
if (gotWidth || gotHeight)
{
// open the parameter object
onload.append(",{");
if (gotWidth)
{
// add in the width parameter
onload.append("W:");
onload.append(widthParam);
}
if (gotHeight)
{
// If something preceded this param, separate with a comma
if (gotWidth)
onload.append(",");
onload.append("H:");
onload.append(heightParam);
}
// close the parameter object
onload.append("}");
}
// close the handler
onload.append(")");
frameSet.setOnload(onload.toString());
// http://issues.apache.org/jira/browse/ADFFACES-191
// Following code was once in CoreRenderKit.launchDialog.
if (returnId != null)
{
StringBuilder onunload = new StringBuilder(53 + returnId.length());
onunload.append(_FRAMESET_ONUNLOAD_TEXT);
onunload.append(";window.opener.setTimeout(");
onunload.append("'ADFDialogReturn[").append(returnId).append("]();'");
onunload.append(",1)");
frameSet.setOnunload(onunload.toString());
}
else
{
frameSet.setOnunload(_FRAMESET_ONUNLOAD_TEXT);
}
root.getChildren().add(frameSet);
}