Package org.primefaces.component.link

Examples of org.primefaces.component.link.Link


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;";
View Full Code Here

TOP

Related Classes of org.primefaces.component.link.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.