You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2007/06/23 21:45:26 UTC

[jira] Commented: (TOMAHAWK-160) ADF Renderer Kit and HtmlCommandLink not rendered

    [ https://issues.apache.org/jira/browse/TOMAHAWK-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507627 ] 

Leonardo Uribe commented on TOMAHAWK-160:
-----------------------------------------

Here is a patch to correct this issue

When you use dataScroller with Trinidad, you cannot press the facet buttons 
that navigate through the component, because it render the link and not include the children 
properly. 

the solution is simple. It's just replace from this:

    protected void renderFacet(FacesContext facesContext, HtmlDataScroller scroller,
                               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);

    }

to this:

    protected void renderFacet(FacesContext facesContext, HtmlDataScroller scroller,
                               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.getChildren().add(facetComp);
        
        link.encodeBegin(facesContext);
        if (link.getRendersChildren())
            link.encodeChildren(facesContext);        
        link.encodeEnd(facesContext);

    }

the facet component is renderer inside the link component, when you use trinidad and tomahawk.





> ADF Renderer Kit and HtmlCommandLink not rendered
> -------------------------------------------------
>
>                 Key: TOMAHAWK-160
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-160
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.2-SNAPSHOT
>         Environment: ADF 10.1.3.04, SUN RI 1.1.01
>            Reporter: Claudio Tasso
>            Priority: Critical
>         Attachments: patch1.patch
>
>
> ADF requires the installation of its custom RendererKit (oracle.adf.core), but it does not work well with some Tomahawk components.
> For example, let's examine the HtmlDataScrollerRenderer, which creates a HtmlCommandLink during the  encoding  of the HtmlDataScroller component.
> This is the code which creates the HtmlCommandLink:
> HtmlCommandLink link = (HtmlCommandLink) application
>                        .createComponent(HtmlCommandLink.COMPONENT_TYPE);
> ....
> scroller.getChildren().add(link);
> It seems to be quite standard: the compoent is created and the it's added to the HtmlDataScroller componet.
> This code works very well when the faces-config.xml DOES NOT contain the following line:
> <default-render-kit-id>oracle.adf.core</default-render-kit-id>
> But when this line is inserted, the HtmlCommandLink does not appear in the rendered page which is sent to the browser as HTML.
> The following JSP code contains an example:
> <%@ page language="java" pageEncoding="UTF-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> 	
> </head>
>   
> <body>
> 	<f:view>		
> 		<h:form>
> 			<t:dataTable id="mytable" rows="1" preserveDataModel="false" value="#{TestBean.persons}" var="item">
> 				<t:column>
> 					<h:outputText value="#{item.name}"></h:outputText>
> 				</t:column>
> 				<t:column>
> 					<h:outputText value="#{item.surname}"></h:outputText>
> 				</t:column>
> 			</t:dataTable>
> 			<t:dataScroller for="mytable">
> 				<f:facet name="next">
>                                         <%-- When the content of this facet is rendered, it should be surrounded by a link --%>
> 					<h:outputText value="Next"/>
> 				</f:facet>
> 			</t:dataScroller>
> 		</h:form>
> 	</f:view>
> </body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.