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

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

Looking more about this subject I have found a correction that works well
for both environments (with and without trinidad)

But the class that needs to be corrected is in trinidad

org.apache.myfaces.trinidadinternal.renderkit.htmlBasic.HtmlCommandLinkRenderer.java

This class delegate to another renderer that belongs to trinidad the layout, 
and do all encoding
in the method encodeEnd:

  @SuppressWarnings("unchecked")
  @Override
  public void encodeEnd(FacesContext context,
                     UIComponent component) throws IOException
  {
    // The tr:commandLink is not a rendersChildren component,
    // but h:commandLink is.  Hence, the difference in behavior
    Renderer renderer = createRenderer(component);
    renderer.encodeBegin(context, component);

    for(UIComponent child : (List<UIComponent>)component.getChildren())
    {
      RenderUtils.encodeRecursive(context, child);
    }

    renderer.encodeEnd(context, component);
  }

The solution is add something like this

  @SuppressWarnings("unchecked")
  @Override
  public void encodeBegin(FacesContext context,
          UIComponent component) throws IOException
  {
          super.encodeBegin(context,component);
      Renderer renderer = createRenderer(component);
          renderer.encodeBegin(context, component);
          
  }

and comment the call of encodeBegin in encode end



> 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
>
> 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.

Reply via email to