you are absolutely right, would be nice to have a fully validated renderkit.

If you look into your faces-config.xml (the one which is delivered
with MyFaces), you will find a render-kit node which looks something
like the following:


    <!-- MyFaces Renderkit Extensions -->

    <render-kit>
        <render-kit-id>HTML_BASIC</render-kit-id>

        <!-- extended standard renderers -->

        <renderer>
            <component-family>javax.faces.Command</component-family>
            <renderer-type>org.apache.myfaces.Button</renderer-type>
            
<renderer-class>org.apache.myfaces.renderkit.html.ext.HtmlButtonRenderer</renderer-class>
        </renderer>

        <renderer>
            <component-family>javax.faces.Command</component-family>
            <renderer-type>org.apache.myfaces.Link</renderer-type>
            
<renderer-class>org.apache.myfaces.renderkit.html.ext.HtmlLinkRenderer</renderer-class>
        </renderer>

.....


What you do know is copy this render-kit node to a separate location
in your personal (or if you donate it back to MyFaces, to the MyFaces
one) faces-config.xml.

First change the renderkit to something like HTML_401 or whatever you want.

Next change all the renderer-class entries to the classes you implemented.

Done - all you have to do now is to reset your renderkit id in the
application section of the faces-config, something like that:

...
    <application>
        <default-render-kit-id>HTML_401</default-render-kit-id>
    </application
...

regards,

Maritn





On 6/16/05, Mark <[EMAIL PROTECTED]> wrote:
> Martin Marinschek wrote:
> 
> >Well, yes, but in this case you are reusing the standard renderkit!
> >
> >if you just want to define an additional renderkit, you "copy" the
> >standard render-kit definition, give it a new rederkit-id, set your
> >renderer names as appropriate, and set the default renderkit to your
> >special render-kit id....
> >
> >regards,
> >
> >Martin
> >
> >On 6/15/05, Mark <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Craig McClanahan wrote:
> >>
> >>
> >>
> >>>On 14 Jun 2005 12:42:01 -0000, mfaine <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Basically I just need to know how to make the current myfaces components 
> >>>>use
> >>>>my Renderer classes which are subclasses of the ones that come with 
> >>>>myfaces.
> >>>>If anyone can tell me how or point me to the right docs I would 
> >>>>appreciate it.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>You can accomplish this by defining your own renderer elements in a
> >>>faces-config.xml file that is loaded *after* the standard one for the
> >>>JSF implementation you are using.  The key requirement is to use the
> >>>same values for <renderer-type> and <component-family> that the
> >>>standard renderer definitions do (for the standard components, these
> >>>values are all in the JSF spec; for the MyFaces extension components,
> >>>look in the faces-config.xml file that defines them).
> >>>
> >>>Craig
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Thanks,
> >>>>-Mark
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>Thanks, I think I got this working now.
> >>
> >>-Mark
> >>
> >>
> >>
> >
> >
> >
> >
> Could you point me to more detailed instructions on doing that?  I'm
> interested in possibly offering up any changes back to the myfaces
> developers.   It would be better in that case that it be a separate
> render kit instead of  reusing the standard render kit.
> 
> Thanks,
> -Mark
> 
>

Reply via email to