public class LinkRenderer extends org.primefaces.component.link.LinkRenderer {
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
Link link = (Link) component;
boolean shouldWriteId = shouldWriteId(link);
boolean disabled = link.isDisabled();
String style = link.getStyle();
String defaultStyleClass = disabled ? Link.MOBILE_DISABLED_STYLE_CLASS: Link.MOBILE_STYLE_CLASS;
String styleClass = link.getStyleClass();
styleClass = (styleClass == null) ? defaultStyleClass : defaultStyleClass + " " + styleClass;
if(disabled) {
writer.startElement("span", link);
if(shouldWriteId) {
writer.writeAttribute("id", link.getClientId(context), "id");
}
writer.writeAttribute("class", styleClass, "styleClass");
if(style != null) {
writer.writeAttribute("style", style, "style");
}
renderContent(context, link);
writer.endElement("span");
}
else {
String outcome = link.getOutcome();
writer.startElement("a", link);
if(shouldWriteId) {
writer.writeAttribute("id", link.getClientId(context), "id");
}
writer.writeAttribute("class", styleClass, "styleClass");
if(outcome != null && outcome.startsWith("pm:")) {
String command = MobileUtils.buildNavigation(outcome) + "return false;";