myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Eduardo Iguaro" <henry.edua...@gmail.com>
Subject Custom Renderer for tr:message doesn't work?...
Date Tue, 19 Feb 2008 23:26:11 GMT
hi, i'm creating a custom renderer for a
org.apache.myfaces.trinidad.component.core.output.CoreMessage component
(aka, a <tr:message /> component), the custom renderer uses javascript
to simulate a small balloon message box. After searching in the source
code, i've found that the default renderer for the CoreMessage is the
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageRenderer, so
i created a copy of it and renamed to my renderer class name, this way i
could test the tag handling before plugin mine own renderer

This is the code that registers the renderer in my faces-config.xml
file.

<render-kit>
        <render-kit-class>
org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit
        </render-kit-class>
        <renderer>
                <component-family>
                        org.apache.myfaces.trinidad.Message
                </component-family>
                <renderer-type>
                        org.apache.myfaces.trinidad.CoreMessage
                </renderer-type>
                <renderer-class>
gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
                </renderer-class>
        </renderer>
</render-kit>

This is the component tag from my tld file:
        <tag>
            <name>balloon-message</name>
<tag-class>gob.sudeban.util.jsf.custom.tags.BalloonMessageTag</tag-class>
                ...

The same atributes for the message tag from the tr.tld file in
trinidad-impl-1.0.6.jar
                ...
        </tag>


The class gob.sudeban.util.jsf.custom.tags.BalloonMessageTag is also a
renamed copy of
org.apache.myfaces.trinidadinternal.taglib.core.output.CoreMessageTag

This is the jsp file i use to test the component:

<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
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/trinidad" prefix="tr" %>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh" %>
<%@ taglib uri="http://sudeban.gob.ve/jsf/component/tags"
prefix="sudeban" %>

<f:view>

<trh:head>
</trh:head>

<trh:body>
        <tr:form>
                <tr:panelFormLayout >
                        <sudeban:balloon-message message="This is a message"
/>
                </tr:panelFormLayout>
        </tr:form>
</trh:body>

When i test the component i get the following:

(HtmlRenderKitImpl.java:79) Unsupported component-family/renderer-type:
org.apache.myfaces.trinidad.Message
/gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
19-feb-2008 16:30:22
org.apache.myfaces.trinidadinternal.renderkit.RenderKitBase getRenderer
WARNING: Renderer
'gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer' not found
for component family 'org.apache.myfaces.trinidad.Message'
19-feb-2008 16:30:22
org.apache.myfaces.trinidad.component.UIXComponentBase _getRendererImpl
WARNING: Could not find renderer for CoreMessage[UIXFacesBeanImpl,
id=_idJsp4] rendererType =
gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
(UIComponentTag.java:500) Exited encodeEnd for client-Id: _idJsp1
19-feb-2008 16:30:22
org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit
encodeFinally
WARNING: No RenderingContext available
19-feb-2008 16:30:22
org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit
encodeFinally
WARNING: No RenderingContext available

And anything get rendered...

What am i doing wrong? It's possible to register another render for a
core component like this?

Any help would be appreciated

(PS: Please excuse my english)

Henry Iguaro

Mime
View raw message