You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by HENRY IGUARO <he...@sudeban.gob.ve> on 2008/02/20 00:04:39 UTC

Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

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)

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Henry Eduardo Iguaro <he...@gmail.com>.
Now it WORKS!! Thanks!!!!

I wish to contribute giving you the source of the renderer, i know is not
big deal but maybe somebody could find it useful

I'm attaching an image of the renderer working, let me know if you're
interested

2008/2/22, Matthias Wessendorf <ma...@apache.org>:
>
> Hi,
>
> >     public String getRendererType()
> >     {
> >     return "gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
> ";
> >      }
>
>
> that doesn't match this:
>
>   <render-kit>
>     <render-kit-id>org.apache.myfaces.trinidadinternal.core
> </render-kit-id>
> ...
>
>       <renderer-type>
>         org.apache.myfaces.trinidad.Message
>
>       </renderer-type>
>       <renderer-class>
>         net.wessendorf.trinidad.CustomMessageRenderer
>
>       </renderer-class>
>     </renderer>
>   </render-kit>
>
>
> have you tried this (in the faces-cfg):
>
>
>   <render-kit>
>     <render-kit-id>org.apache.myfaces.trinidadinternal.core
> </render-kit-id>
>
>     <renderer>
>       <component-family>
>         org.apache.myfaces.trinidad.Message
>       </component-family>
>       <renderer-type>
>
>         gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
>
>       </renderer-type>
>       <renderer-class>
>         net.wessendorf.trinidad.CustomMessageRenderer
>
>       </renderer-class>
>     </renderer>
>   </render-kit>
>
>
>
> Please note, that render-type is a String (not a class).
>
>
> -Matthias
>
>
>
> >
> >     // The rest is a copy of the CoreMessageTag class
> > }
> >
> > But it still get the error output i posted before...
> >
> > For now, i'm going to add an atribute to change the renderer dinamically
> >
> >  What can i do to implement the custom tag without the error?
> >
> >
> > 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> >
> > > Thanks a lot!
> > >
> > >
> > > 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> > >
> > > > Hi,
> > > >
> > > > I answered your *old* post already.
> > > >
> > > > Here is a little bit more on that:
> > > >
> > > >
> >
> http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> > > >
> > > > -Matthias
> > > >
> > > > On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> > wrote:
> > > > >
> > > > >
> > > > >
> > > > > 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)
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > sessions: http://www.slideshare.net/mwessendorf
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > >
> > > --
> > > -----BEGIN GEEK CODE BLOCK-----
> > > Version: 3.1
> > > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++
> E----
> > w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > > ------END GEEK CODE BLOCK------
> >
> >
> >
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$
> > 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> >  ------END GEEK CODE BLOCK------
>
>
>
>
> --
>
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org
>



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,
>     public String getRendererType()
>     {
>     return "gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer";
>      }

that doesn't match this:

  <render-kit>
    <render-kit-id>org.apache.myfaces.trinidadinternal.core</render-kit-id>
...
      <renderer-type>
        org.apache.myfaces.trinidad.Message
      </renderer-type>
      <renderer-class>
        net.wessendorf.trinidad.CustomMessageRenderer
      </renderer-class>
    </renderer>
  </render-kit>

have you tried this (in the faces-cfg):


  <render-kit>
    <render-kit-id>org.apache.myfaces.trinidadinternal.core</render-kit-id>
    <renderer>
      <component-family>
        org.apache.myfaces.trinidad.Message
      </component-family>
      <renderer-type>
        gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer
      </renderer-type>
      <renderer-class>
        net.wessendorf.trinidad.CustomMessageRenderer
      </renderer-class>
    </renderer>
  </render-kit>


Please note, that render-type is a String (not a class).

-Matthias


>
>     // The rest is a copy of the CoreMessageTag class
> }
>
> But it still get the error output i posted before...
>
> For now, i'm going to add an atribute to change the renderer dinamically
>
>  What can i do to implement the custom tag without the error?
>
>
> 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
>
> > Thanks a lot!
> >
> >
> > 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> >
> > > Hi,
> > >
> > > I answered your *old* post already.
> > >
> > > Here is a little bit more on that:
> > >
> > >
> http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> > >
> > > -Matthias
> > >
> > > On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> wrote:
> > > >
> > > >
> > > >
> > > > 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)
> > > >
> > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > sessions: http://www.slideshare.net/mwessendorf
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > ------END GEEK CODE BLOCK------
>
>
>
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
> 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
>  ------END GEEK CODE BLOCK------



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Henry Eduardo Iguaro <he...@gmail.com>.
Hi Andrew,

Thanks, but i rather prefer to do it manually, i know than that doesn't
sound good but, to tell you the truth i don't know maven very much and i
wish to keep control of the underlying process, just in case :)  (besides
and using Eclipse and got messy trying to use the Maven plug-in within it).
So if somebody know how to do it manually or has a link to a tutorial,
please let me know

I've been trying to find something by myself but i haven't had too much
success

Thanks in advance and again sorry

2008/2/21, Andrew Robinson <an...@gmail.com>:
>
> If you use the maven-faces-plugin for you project, you can create a
> new component, tag and tie it to a new renderer type. Just have it
> extend the messages ones. You can do it without the plugin, but you
> would have to do all of that manually.
>
> For the setup, see the wiki and use the tr:messages files as an example
>
>
> -Andrew
>
>
> On Wed, Feb 20, 2008 at 3:27 PM, Henry Eduardo Iguaro
> <he...@gmail.com> wrote:
> > Now that i realize, i can not add the attribute to the tr:message tag...
> I
> > don't know what was thinking, but, i still have the problem i posted
> before
> >
> >
> >
> > 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> > > Hi Matthias,
> > >
> > > The solution you provide for my problem worked, but... i have to mix
> > tr:message tags rendered with the core Trinidad renderer and the custom
> > ones, thats why i create my custom tag, so i could separate the use of
> one
> > renderer from another
> > >
> > > Here, this is the code of the BalloonMessageTag custom tag class
> > >
> > > public class BalloonMessageTag extends UIXMessageTag
> > > {
> > >
> > >     /**
> > >      * Construct an instance of the CoreMessageTag.
> > >      */
> > >     public BalloonMessageTag()
> > >     {
> > >     }
> > >
> > >     public String getComponentType()
> > >     {
> > >     return "org.apache.myfaces.trinidad.CoreMessage";
> > >     }
> > >
> > >     public String getRendererType()
> > >     {
> > >     return "
> gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer";
> > >     }
> > >
> > >     // The rest is a copy of the CoreMessageTag class
> > > }
> > >
> > > But it still get the error output i posted before...
> > >
> > > For now, i'm going to add an atribute to change the renderer
> dinamically
> > >
> > > What can i do to implement the custom tag without the error?
> > >
> > >
> > >
> > > 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> > >
> > > > Thanks a lot!
> > > >
> > > >
> > > > 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> > > >
> > > > > Hi,
> > > > >
> > > > > I answered your *old* post already.
> > > > >
> > > > > Here is a little bit more on that:
> > > > >
> > > > >
> >
> http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> > > > >
> > > > > -Matthias
> > > > >
> > > > > On Feb 20, 2008 12:04 AM, HENRY IGUARO <
> henry.iguaro@sudeban.gob.ve>
> > wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > 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)
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Matthias Wessendorf
> > > > >
> > > > > further stuff:
> > > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > > sessions: http://www.slideshare.net/mwessendorf
> > > > > mail: matzew-at-apache-dot-org
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > -----BEGIN GEEK CODE BLOCK-----
> > > > Version: 3.1
> > > > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++
> E----
> > w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > > > ------END GEEK CODE BLOCK------
> > >
> > >
> > >
> > >
> > > --
> > > -----BEGIN GEEK CODE BLOCK-----
> > > Version: 3.1
> > > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++
> E----
> > w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > > ------END GEEK CODE BLOCK------
> >
> >
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$
> > 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> >  ------END GEEK CODE BLOCK------
>



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Andrew Robinson <an...@gmail.com>.
If you use the maven-faces-plugin for you project, you can create a
new component, tag and tie it to a new renderer type. Just have it
extend the messages ones. You can do it without the plugin, but you
would have to do all of that manually.

For the setup, see the wiki and use the tr:messages files as an example

-Andrew

On Wed, Feb 20, 2008 at 3:27 PM, Henry Eduardo Iguaro
<he...@gmail.com> wrote:
> Now that i realize, i can not add the attribute to the tr:message tag... I
> don't know what was thinking, but, i still have the problem i posted before
>
>
>
> 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> > Hi Matthias,
> >
> > The solution you provide for my problem worked, but... i have to mix
> tr:message tags rendered with the core Trinidad renderer and the custom
> ones, thats why i create my custom tag, so i could separate the use of one
> renderer from another
> >
> > Here, this is the code of the BalloonMessageTag custom tag class
> >
> > public class BalloonMessageTag extends UIXMessageTag
> > {
> >
> >     /**
> >      * Construct an instance of the CoreMessageTag.
> >      */
> >     public BalloonMessageTag()
> >     {
> >     }
> >
> >     public String getComponentType()
> >     {
> >     return "org.apache.myfaces.trinidad.CoreMessage";
> >     }
> >
> >     public String getRendererType()
> >     {
> >     return "gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer";
> >     }
> >
> >     // The rest is a copy of the CoreMessageTag class
> > }
> >
> > But it still get the error output i posted before...
> >
> > For now, i'm going to add an atribute to change the renderer dinamically
> >
> > What can i do to implement the custom tag without the error?
> >
> >
> >
> > 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> >
> > > Thanks a lot!
> > >
> > >
> > > 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> > >
> > > > Hi,
> > > >
> > > > I answered your *old* post already.
> > > >
> > > > Here is a little bit more on that:
> > > >
> > > >
> http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> > > >
> > > > -Matthias
> > > >
> > > > On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> wrote:
> > > > >
> > > > >
> > > > >
> > > > > 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)
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > sessions: http://www.slideshare.net/mwessendorf
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > >
> > > --
> > > -----BEGIN GEEK CODE BLOCK-----
> > > Version: 3.1
> > > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > > ------END GEEK CODE BLOCK------
> >
> >
> >
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > ------END GEEK CODE BLOCK------
>
>
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
> 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
>  ------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Henry Eduardo Iguaro <he...@gmail.com>.
Now that i realize, i can not add the attribute to the tr:message tag... I
don't know what was thinking, but, i still have the problem i posted before

2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
>
> Hi Matthias,
>
> The solution you provide for my problem worked, but... i have to mix
> tr:message tags rendered with the core Trinidad renderer and the custom
> ones, thats why i create my custom tag, so i could separate the use of one
> renderer from another
>
> Here, this is the code of the BalloonMessageTag custom tag class
>
> public class BalloonMessageTag extends UIXMessageTag
> {
>
>     /**
>      * Construct an instance of the CoreMessageTag.
>      */
>     public BalloonMessageTag()
>     {
>     }
>
>     public String getComponentType()
>     {
>     return "org.apache.myfaces.trinidad.CoreMessage";
>     }
>
>     public String getRendererType()
>     {
>     return "gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer";
>     }
>
>     // The rest is a copy of the CoreMessageTag class
> }
>
> But it still get the error output i posted before...
>
> For now, i'm going to add an atribute to change the renderer dinamically
>
> What can i do to implement the custom tag without the error?
>
>
> 2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
> >
> > Thanks a lot!
> >
> > 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> > >
> > > Hi,
> > >
> > > I answered your *old* post already.
> > >
> > > Here is a little bit more on that:
> > >
> > >
> > > http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> > >
> > > -Matthias
> > >
> > > On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> > > wrote:
> > > >
> > > >
> > > >
> > > > hi, i'm creating a custom renderer for a
> > > >  org.apache.myfaces.trinidad.component.core.output.CoreMessagecomponent
> > > >  (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.RenderKitBasegetRenderer
> > > >  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)
> > > >
> > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > sessions: http://www.slideshare.net/mwessendorf
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> > w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> > ------END GEEK CODE BLOCK------
>
>
>
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> ------END GEEK CODE BLOCK------
>



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Henry Eduardo Iguaro <he...@gmail.com>.
Hi Matthias,

The solution you provide for my problem worked, but... i have to mix
tr:message tags rendered with the core Trinidad renderer and the custom
ones, thats why i create my custom tag, so i could separate the use of one
renderer from another

Here, this is the code of the BalloonMessageTag custom tag class

public class BalloonMessageTag extends UIXMessageTag
{

    /**
     * Construct an instance of the CoreMessageTag.
     */
    public BalloonMessageTag()
    {
    }

    public String getComponentType()
    {
    return "org.apache.myfaces.trinidad.CoreMessage";
    }

    public String getRendererType()
    {
    return "gob.sudeban.util.jsf.custom.renderers.MessageBalloonRenderer";
    }

    // The rest is a copy of the CoreMessageTag class
}

But it still get the error output i posted before...

For now, i'm going to add an atribute to change the renderer dinamically

What can i do to implement the custom tag without the error?


2008/2/21, Henry Eduardo Iguaro <he...@gmail.com>:
>
> Thanks a lot!
>
> 2008/2/21, Matthias Wessendorf <ma...@apache.org>:
> >
> > Hi,
> >
> > I answered your *old* post already.
> >
> > Here is a little bit more on that:
> >
> >
> > http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
> >
> > -Matthias
> >
> > On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> > wrote:
> > >
> > >
> > >
> > > hi, i'm creating a custom renderer for a
> > >  org.apache.myfaces.trinidad.component.core.output.CoreMessagecomponent
> > >  (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.RenderKitBasegetRenderer
> > >  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)
> > >
> >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > sessions: http://www.slideshare.net/mwessendorf
> > mail: matzew-at-apache-dot-org
> >
>
>
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E----
> w++$ 5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
> ------END GEEK CODE BLOCK------




-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Henry Eduardo Iguaro <he...@gmail.com>.
Thanks a lot!

2008/2/21, Matthias Wessendorf <ma...@apache.org>:
>
> Hi,
>
> I answered your *old* post already.
>
> Here is a little bit more on that:
>
>
> http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/
>
> -Matthias
>
> On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve>
> wrote:
> >
> >
> >
> > 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)
> >
>
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org
>



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O G++@ s-:+>:+ a25 tv+ d++> t+ C+++>+ U++>+++ P+ L++>+++ W+++ E---- w++$
5 X R-@ b+>++ D+ e>++ o? O? h--@ r+ y++ K? M PS+
------END GEEK CODE BLOCK------

Re: Custom Renderer fororg.apache.myfaces.trinidad.component.core.output.CoreMessage doesn'twork?...

Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,

I answered your *old* post already.

Here is a little bit more on that:

http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/

-Matthias

On Feb 20, 2008 12:04 AM, HENRY IGUARO <he...@sudeban.gob.ve> wrote:
>
>
>
> 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)
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org