FAQ
I've extended all the classes under org.apache.myfaces.renderkit.html.ext
and added code to some of them ( I'll get to all of them eventually ) to
make them (hopefully) more Accessible so that the HTML produced will pass
Section 508 validation. I want to add this as a render kit but I can't find
any documentation on how to add new render kits. I do not know what is
required in order to make myfaces use these classes instead of the stock
myfaces classes.

Thanks,
-Mark

Search Discussions

  • Martin Marinschek at Jun 14, 2005 at 10:42 am
    you need to set that in your faces config - where you set your
    default-locale, don't ask me for the correct xml-tag though.. maybe
    'default-renderkit-id'?

    I would look it up in the dtd or in the spec!

    regards,

    Martin
    On 13 Jun 2005 19:00:08 -0000, mfaine wrote:
    I've extended all the classes under org.apache.myfaces.renderkit.html.ext
    and added code to some of them ( I'll get to all of them eventually ) to
    make them (hopefully) more Accessible so that the HTML produced will pass
    Section 508 validation. I want to add this as a render kit but I can't find
    any documentation on how to add new render kits. I do not know what is
    required in order to make myfaces use these classes instead of the stock
    myfaces classes.

    Thanks,
    -Mark
  • Mfaine at Jun 14, 2005 at 12:42 pm
    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.

    Thanks,
    -Mark
  • Balaji Saranathan at Jun 14, 2005 at 2:50 pm
    Hi,

    I'm trying to create a custom component and one of my requirements is to
    attach the Regular Expression Validator of myfaces to the input fields
    created by the component. I did a addValidator() to the HtmlInputText
    component that I created in the encodeChildren() of the custom component
    class. However, the validate() is not being called at all. Am I missing
    something here?

    TIA
    bala




    Confidentiality Notice

    The information contained in this electronic message and any attachments to this message are intended
    for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
    you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
    and destroy all copies of this message and any attachments.
  • Csík Norbert at Jun 15, 2005 at 12:42 pm
    Maybe the encodeChildren method is never called. Due to the spec "This
    method will only be called if the rendersChildren property is true."
    On 6/14/05, Balaji Saranathan wrote:


    Hi,

    I'm trying to create a custom component and one of my requirements is to
    attach the Regular Expression Validator of myfaces to the input fields
    created by the component. I did a addValidator() to the HtmlInputText
    component that I created in the encodeChildren() of the custom component
    class. However, the validate() is not being called at all. Am I missing
    something here?

    TIA
    bala




    Confidentiality Notice

    The information contained in this electronic message and any attachments to this message are intended
    for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
    you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
    and destroy all copies of this message and any attachments.

    --
    Norbert Csík
  • Craig McClanahan at Jun 14, 2005 at 4:17 pm

    On 14 Jun 2005 12:42:01 -0000, mfaine 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
  • Mark at Jun 15, 2005 at 3:03 am

    Craig McClanahan wrote:
    On 14 Jun 2005 12:42:01 -0000, mfaine 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
  • Martin Marinschek at Jun 15, 2005 at 6:11 am
    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 wrote:
    Craig McClanahan wrote:
    On 14 Jun 2005 12:42:01 -0000, mfaine 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
  • Juan Medín Piñeiro at Jun 15, 2005 at 7:41 am
    Hi,

    For some reason JSCookMenu is ignoring the actions assigned to the
    NavigationMenuItem's. I'm using Sun RI (RSA 6.0 distribution) and the
    myfaces-extensions.jar.

    Converting the POSTto a GET (just to know what is being sent), this
    is the string:

    http://localhost:8080/testApp/faces/index.jsp?autoScroll=&jscook_action=formIndex__id0_menu%3AtestOption

    "testOption" is the action, so it's being sent without problems.

    The relevant parts of faces-config.xml are:

    <navigation-rule>
    <from-view-id> * </from-view-id>
    <navigation-case>
    <from-outcome>test</from-outcome>
    <to-view-id>/testpage.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id> * </from-view-id>
    <navigation-case>
    <to-view-id>/whateverSelected.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

    Please notice that the second rule should be executed in any case.
    Well, the browser just reloads the current page every time I select an
    option in the menu. JSCookMenu ignores both rules.Looks like the menu
    isn't aware of the config file.

    Could anyone confirm that JSCookMenu actions work without problems in
    Sun JSF RI + myfaces-extensions? Is there anything else I should add
    to the web.xml besides the extensions filter?

    Thanks in advance,

    - Juan
  • Mark at Jun 16, 2005 at 3:26 am

    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 wrote:

    Craig McClanahan wrote:


    On 14 Jun 2005 12:42:01 -0000, mfaine 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
  • Martin Marinschek at Jun 16, 2005 at 6:53 am
    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 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 wrote:

    Craig McClanahan wrote:


    On 14 Jun 2005 12:42:01 -0000, mfaine 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
  • Juan Medín Piñeiro at Jun 15, 2005 at 7:49 am
    Hi,

    For some reason JSCookMenu is ignoring the actions assigned to the
    NavigationMenuItem's. I'm using Sun RI (RSA 6.0 distribution) and the
    myfaces-extensions.jar.

    Converting the POSTto a GET (just to know what is being sent), this
    is the string:

    http://localhost:8080/testApp/faces/index.jsp?autoScroll=&jscook_action=formIndex__id0_menu%3AtestOption

    "testOption" is the action, so it's being sent without problems.

    The relevant parts of faces-config.xml are:

    <navigation-rule>
    <from-view-id> * </from-view-id>
    <navigation-case>
    <from-outcome>test</from-outcome>
    <to-view-id>/testpage.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id> * </from-view-id>
    <navigation-case>
    <to-view-id>/whateverSelected.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

    Please notice that the second rule should be executed in any case.
    Well, the browser just reloads the current page every time I select an
    option in the menu. JSCookMenu ignores both rules.Looks like the menu
    isn't aware of the config file.

    Could anyone confirm that JSCookMenu actions work without problems in
    Sun JSF RI + myfaces-extensions? Is there anything else I should add
    to the web.xml besides the extensions filter?

    Thanks in advance,

    - Juan
  • Michael Hartmann at Jun 19, 2005 at 6:59 pm
    It's a very interesting topic you are all discussing.

    I'm looking to do kind of the same.

    I want to use the WML renderkit to render the custom JSF "HTML" components
    like "data_table", so it is possible in the jsp files to use the standard
    HTML tags and not the wap ones.

    <h:dataTable... instead of <wap:dataTable..



    Have anybody tried this before?



    Kind Regards,

    Michael Hartmann

    Email: mh AT eyeloop DOT net


    On 6/16/05, Martin Marinschek wrote:

    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</re
    nderer-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</rend
    erer-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 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 wrote:
    > > >

    > > >
    Craig McClanahan wrote:
    > > >>

    > > >>

    > > >>
    On 14 Jun 2005 12:42:01 -0000, mfaine 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
    > >

    > >

    >

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedJun 13, '05 at 7:00p
activeJun 19, '05 at 6:59p
posts13
users7
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase