}
final String formClientId = uiform.getClientId(context);
// start differences from command link
final ResponseWriter writer = context.getResponseWriter();
commonJavascript(
context,
command);
writer.startElement(
"a",
command);
writer.writeAttribute(
"href",
"#",
null);
String form = "document.forms['" + formClientId + "']";
StringBuffer buffer = new StringBuffer();
buffer.append("showPopupFrame(");
buffer.append(form);
buffer.append(",this,event");
buffer.append(",'");
buffer.append(getHiddenFieldClose(
command,
context));
buffer.append("','");
buffer.append(command.getStyleClassFrame() == null ? "" : command.getStyleClassFrame());
buffer.append("','");
buffer.append(DEFAULT_STYLE);
buffer.append(command.getStyleFrame() == null ? "" : command.getStyleFrame());
buffer.append("',");
buffer.append(command.getMouseHorizPos() == null ? "0" : command.getMouseHorizPos());
buffer.append(",");
buffer.append(command.getMouseVertPos() == null ? "0" : command.getMouseVertPos());
buffer.append(",");
buffer.append(command.getAbsolute() == null ? "false" : command.getAbsolute());
buffer.append(",");
buffer.append(command.getCenter() == null ? "false" : command.getCenter());
buffer.append(",'");
buffer.append(command.getHeight() == null ? "" : command.getHeight());
buffer.append("','");
buffer.append(command.getWidth() == null ? "" : command.getWidth());
buffer.append("','");
buffer.append(command.getScrolling() == null ? "auto" : command.getScrolling().toLowerCase());
buffer.append("');");
buffer.append(form);
buffer.append(".target='");
buffer.append("hiddenPopupFrameTarget");
buffer.append("';");
buffer.append(form);
buffer.append(".elements['");
buffer.append(POPUP_FRAME_HIDDEN);
buffer.append("'].value='");
buffer.append(getHiddenFieldOpen(
command,
context));
buffer.append("';");
buffer.append(form);
buffer.append(".submit();");
buffer.append(form);
buffer.append(".elements['");
buffer.append(POPUP_FRAME_HIDDEN);
buffer.append("'].value='';");
buffer.append(form);
buffer.append(".target='';");
buffer.append("return false;");
writer.writeAttribute(
"onclick",
buffer.toString(),
null);
writer.writeAttribute(
"id",
command.getClientId(context),
null);
final String accesskey = command.getAccesskey();
if (accesskey != null)
{
writer.writeAttribute(
"accesskey",
accesskey,
"accesskey");
}
final String directory = command.getDir();
if (directory != null)
{
writer.writeAttribute(
"dir",
directory,
"dir");
}
final String lang = command.getLang();
if (lang != null)
{
writer.writeAttribute(
"lang",
lang,
"lang");
}
final String tabindex = command.getTabindex();
if (tabindex != null)
{
writer.writeAttribute(
"tabindex",
tabindex,
"tabindex");
}
final String title = command.getTitle();
if (title != null)
{
writer.writeAttribute(
"title",
title,
"title");
}
final String styleClass = command.getStyleClass();
if (styleClass != null)
{
writer.writeAttribute(
"class",
styleClass,
"styleClass");
}
final String style = command.getStyle();
if (style != null)
{
writer.writeAttribute(
"style",
style,
"style");
}
String label = null;
final Object value = ((UICommand)component).getValue();
if (value != null)
{
label = value.toString();
}
if (label != null && label.length() != 0)
{
writer.write(label);
}
writer.flush();
}
}