Examples of HtmlCommandLink


Examples of javax.faces.component.html.HtmlCommandLink

        Assert.assertNotNull(panelGroup1);
        UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.getChildren().get(0);
        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlCommandLink link = (HtmlCommandLink) facet1.findComponent("link");
        Assert.assertNotNull(link);
        Assert.assertEquals(1, link.getClientBehaviors().size());
        Assert.assertEquals(1, link.getClientBehaviors().get(link.getDefaultEventName()).size());
        /*
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

        Assert.assertNotNull(panelGroup1);
        UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.getChildren().get(0);
        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlCommandLink link = (HtmlCommandLink) compositeComponent1.findComponent("link");
        Assert.assertNotNull(link);
        Assert.assertEquals(1, link.getClientBehaviors().size());
        Assert.assertEquals(1, link.getClientBehaviors().get(link.getDefaultEventName()).size());
        /*
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

        Assert.assertNotNull(panelGroup1);
        UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.getChildren().get(0);
        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlCommandLink link = (HtmlCommandLink) facet1.findComponent("link");
        Assert.assertNotNull(link);
        Assert.assertEquals(0, link.getClientBehaviors().size());
        /*
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

                resetId = linkToReset.getId();
                linkToReset.setId(collapsiblePanel.getId() + LINK_ID);
            }
        }
        else {
            HtmlCommandLink link = getLink(facesContext, collapsiblePanel);
            collapsiblePanel.getChildren().add(link);

            headerComp = link;
        }
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

    }

    protected HtmlCommandLink getLink(FacesContext facesContext, HtmlCollapsiblePanel collapsiblePanel)
        throws IOException {
        Application application = facesContext.getApplication();
        HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
        link.setId(collapsiblePanel.getId() + LINK_ID);
        link.setTransient(true);
        link.setImmediate(true);
        //link.addActionListener(new ChangeCollapsedHandler());

        List children = link.getChildren();
        // Create the indicator. You could later make this conditional and render optional images instead
        HtmlOutputText uiText = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
        uiText.setTransient(true);
        uiText.setValue(collapsiblePanel.isCollapsed() ? ">" : "ν");
        uiText.setEscape(false);
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

                               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

Examples of javax.faces.component.html.HtmlCommandLink

            {
                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

Examples of javax.faces.component.html.HtmlCommandLink

                                      String text, int pageIndex)
    {
        String id = HtmlDataScrollerRenderer.PAGE_NAVIGATION + Integer.toString(pageIndex);
        Application application = facesContext.getApplication();

        HtmlCommandLink link = (HtmlCommandLink) application
                        .createComponent(HtmlCommandLink.COMPONENT_TYPE);
        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);
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandLink

    protected HtmlCommandLink getLink(FacesContext facesContext, HtmlDataScroller scroller,
                                      String facetName)
    {
        Application application = facesContext.getApplication();

        HtmlCommandLink link = (HtmlCommandLink) application
                        .createComponent(HtmlCommandLink.COMPONENT_TYPE);
        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

Examples of javax.faces.component.html.HtmlCommandLink

            throws IOException
    {
        Converter converter = getConverter(component);

        Application application = facesContext.getApplication();
        HtmlCommandLink link
                = (HtmlCommandLink)application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
        link.setId(component.getId() + "_" + valueForLink.getTime() + "_link");
        link.setTransient(true);
        link.setImmediate(component.isImmediate());

        HtmlOutputText text
                = (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
        text.setValue(content);
        text.setId(component.getId() + "_" + valueForLink.getTime() + "_text");
        text.setTransient(true);

        UIParameter parameter
                = (UIParameter)application.createComponent(UIParameter.COMPONENT_TYPE);
        parameter.setId(component.getId() + "_" + valueForLink.getTime() + "_param");
        parameter.setTransient(true);
        parameter.setName(component.getClientId(facesContext));
        parameter.setValue(converter.getAsString(facesContext, component, valueForLink));

        HtmlInputCalendar calendar = (HtmlInputCalendar)component;
        if (calendar.isDisabled() || calendar.isReadonly())
        {
            component.getChildren().add(text);

            RendererUtils.renderChild(facesContext, text);
        }
        else
        {
            RendererUtils.addOrReplaceChild(component,link);
            link.getChildren().add(parameter);
            link.getChildren().add(text);

            RendererUtils.renderChild(facesContext, link);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.