public class CommandLinkRenderer extends OUICommandRenderer {
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
CommandLink link = (CommandLink) component;
writer.startElement(getTagName(link), link);
Rendering.writeIdAttribute(context, component);
writer.writeAttribute("href", "#", null);
Rendering.writeAttributes(writer, link,
"accesskey",
"tabindex",
"lang",
"title",
"dir",
"charset",
"coords",
"hreflang",
"rel",
"rev",
"shape",
"target",
"type");
Rendering.writeStyleAndClassAttributes(writer, link);
boolean ajaxJsRequired = writeEventsWithAjaxSupport(context, writer, link,
getActionRequestKey(context, component));
if (ajaxJsRequired)
link.getAttributes().put("_ajaxRequired", Boolean.TRUE);
Object value = link.getValue();
if (value != null) {
boolean hasExplicitContent = false;
List<UIComponent> children = link.getChildren();
for (UIComponent child : children) {
if (!(child instanceof OUIClientAction) && !Rendering.isA4jSupportComponent(child)) {
hasExplicitContent = true;
break;
}