Package org.openfaces.component.command

Examples of org.openfaces.component.command.CommandLink


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


    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        CommandLink link = (CommandLink) component;

        ScriptBuilder sb = new ScriptBuilder().functionCall("O$.Link._init", link, link.isDisabled(),
                Styles.getCSSClass(context, link, link.getDisabledStyle(), StyleGroup.disabledStyleGroup(),
                        link.getDisabledClass(), "o_link_disabled " + DefaultStyles.getTextColorClass()));
        Rendering.renderInitScript(context, sb, Resources.utilJsURL(context));

        writer.endElement(getTagName(link));
        Resources.renderJSLinkIfNeeded(context, Resources.utilJsURL(context));
        if (link.getAttributes().remove("_ajaxRequired") != null)
            AjaxUtil.renderJSLinks(context);
    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.command.CommandLink

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.