Package org.apache.myfaces.component.html.ext

Examples of org.apache.myfaces.component.html.ext.HtmlCommandLink


                               UIComponent facetComp, String facetName, boolean active, boolean renderLinks, boolean disableLinks) throws IOException
    {
        String onclick = scroller.getOnclick();
        String ondblclick = scroller.getOndblclick();

        HtmlCommandLink link = getLink(facesContext, scroller, facetName);

        if(onclick != null){
            link.setOnclick(onclick);
        }

        if(ondblclick != null){
            link.setOndblclick(ondblclick);
        }

        if (active) {
            if (disableLinks && link.isDisabled())
            {
                //Enable because the facet is active
                link.setDisabled(false);
            }
            link.encodeBegin(facesContext);
        }
        else if (renderLinks)
        {
            if (disableLinks && !link.isDisabled())
            {
                //Disable because the facet is not active
                link.setDisabled(true);
            }
            link.encodeBegin(facesContext);
        }

        facetComp.encodeBegin(facesContext);
        if (!facetComp.getRendersChildren())
            facetComp.encodeChildren(facesContext);
        facetComp.encodeEnd(facesContext);

        if (active || renderLinks) {
            link.encodeEnd(facesContext);
        }
    }
View Full Code Here


            {
                writer.write(Integer.toString(idx));
            }
            else
            {
                HtmlCommandLink link = getLink(facesContext, scroller, Integer.toString(idx), idx);
                if(onclick != null){
                    link.setOnclick(onclick);
                }
                if(ondblclick != null){
                    link.setOndblclick(ondblclick);
                }

                link.encodeBegin(facesContext);
                link.encodeChildren(facesContext);
                link.encodeEnd(facesContext);
            }

            writePaginatorElementEnd(writer, scroller);
        }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + id);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();

            //Copy all client behaviors
            for (Map.Entry<String,List<ClientBehavior>> entry : scroller.getClientBehaviors().entrySet())
            {
                List<ClientBehavior> list = entry.getValue();
                if (list != null && !list.isEmpty())
                {
                    for (ClientBehavior cb : list)
                    {
                        link.addClientBehavior(entry.getKey(), cb);
                    }
                }
            }

            link.setId(scroller.getId() + id);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + id + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(id);
            List children = link.getChildren();
            children.add(parameter);
            if (text != null)
            {
                HtmlOutputText uiText = (HtmlOutputText) application
                                .createComponent(HtmlOutputText.COMPONENT_TYPE);
                uiText.setId(scroller.getId() + id + "_text");
                uiText.setTransient(true);
                uiText.setValue(text);
                children.add(uiText);
            }
            scroller.getChildren().add(link);
        }
        else
        {
            UIOutput uiText = (UIOutput) link.findComponent(scroller.getId() + id + "_text");
            if (uiText != null)
            {
                //Update text value
                uiText.setValue(text);
            }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + facetName);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();
   
            //Copy all client behaviors
            for (Map.Entry<String,List<ClientBehavior>> entry : scroller.getClientBehaviors().entrySet())
            {
                List<ClientBehavior> list = entry.getValue();
                if (list != null && !list.isEmpty())
                {
                    for (ClientBehavior cb : list)
                    {
                        link.addClientBehavior(entry.getKey(), cb);
                    }
                }
            }
           
            link.setId(scroller.getId() + facetName);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + facetName + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(facetName);
            List children = link.getChildren();
            children.add(parameter);
            scroller.getChildren().add(link);
        }
        return link;
    }
View Full Code Here

                               UIComponent facetComp, String facetName) throws IOException
    {
        String onclick = scroller.getOnclick();
        String ondblclick = scroller.getOndblclick();

        HtmlCommandLink link = getLink(facesContext, scroller, facetName);
        if(onclick != null){
            link.setOnclick(onclick);
        }
        if(ondblclick != null){
            link.setOndblclick(ondblclick);
        }

        link.encodeBegin(facesContext);
        facetComp.encodeBegin(facesContext);
        if (!facetComp.getRendersChildren())
            facetComp.encodeChildren(facesContext);
        facetComp.encodeEnd(facesContext);
        link.encodeEnd(facesContext);
    }
View Full Code Here

            {
                writer.write(Integer.toString(idx));
            }
            else
            {
                HtmlCommandLink link = getLink(facesContext, scroller, Integer.toString(idx), idx);
                if(onclick != null){
                    link.setOnclick(onclick);
                }
                if(ondblclick != null){
                    link.setOndblclick(ondblclick);
                }

                link.encodeBegin(facesContext);
                link.encodeChildren(facesContext);
                link.encodeEnd(facesContext);
            }

            writePaginatorElementEnd(writer, scroller);
        }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + id);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();

            link.setId(scroller.getId() + id);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + id + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(id);
            List children = link.getChildren();
            children.add(parameter);
            if (text != null)
            {
                HtmlOutputText uiText = (HtmlOutputText) application
                                .createComponent(HtmlOutputText.COMPONENT_TYPE);
                uiText.setId(scroller.getId() + id + "_text");
                uiText.setTransient(true);
                uiText.setValue(text);
                children.add(uiText);
            }
            scroller.getChildren().add(link);
        }
        else
        {
            UIOutput uiText = (UIOutput) link.findComponent(scroller.getId() + id + "_text");
            if (uiText != null)
            {
                //Update text value
                uiText.setValue(text);
            }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + facetName);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();
   
            link.setId(scroller.getId() + facetName);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + facetName + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(facetName);
            List children = link.getChildren();
            children.add(parameter);
            scroller.getChildren().add(link);
        }
        return link;
    }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + id);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();

            link.setId(scroller.getId() + id);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + id + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(id);
            List children = link.getChildren();
            children.add(parameter);
            if (text != null)
            {
                HtmlOutputText uiText = (HtmlOutputText) application
                                .createComponent(HtmlOutputText.COMPONENT_TYPE);
                uiText.setId(scroller.getId() + id + "_text");
                uiText.setTransient(true);
                uiText.setValue(text);
                children.add(uiText);
            }
            scroller.getChildren().add(link);
        }
        else
        {
            UIOutput uiText = (UIOutput) link.findComponent(scroller.getId() + id + "_text");
            if (uiText != null)
            {
                //Update text value
                uiText.setValue(text);
            }
View Full Code Here

        // Theorically this method should always return null, but it is known
        // than in some cases (portlet) when the state manager is different from
        // the default one, transient components are saved on the component tree.
        // Really the error is on the jsf portlet bridge implementation used, but
        // do this does not cause any side effect.
        HtmlCommandLink link = (HtmlCommandLink) scroller.findComponent(scroller.getId() + facetName);
        if (link == null)
        {
            // See Jira Issue TOMAHAWK-117 http://issues.apache.org/jira/browse/TOMAHAWK-117
            //     and http://issues.apache.org/jira/browse/MYFACES-1809
            link = new org.apache.myfaces.component.html.ext.HtmlCommandLink();
   
            link.setId(scroller.getId() + facetName);
            link.setTransient(true);
            UIParameter parameter = (UIParameter) application
                            .createComponent(UIParameter.COMPONENT_TYPE);
            parameter.setId(scroller.getId() + facetName + "_param");
            parameter.setTransient(true);
            parameter.setName(scroller.getClientId(facesContext));
            parameter.setValue(facetName);
            List children = link.getChildren();
            children.add(parameter);
            scroller.getChildren().add(link);
        }
        return link;
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.component.html.ext.HtmlCommandLink

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.