Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8193367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:27:26+00:00 2026-06-07T04:27:26+00:00

The JSF component SelectOneRadio layout is very limited so I wrote a custom Renderer

  • 0

The JSF component SelectOneRadio layout is very limited so I wrote a custom Renderer for it, and it works great. However, there are times when I want to use the standard SelectOneRadio layout as well. So I decide to make my new component that utilize the custom Renderer I create, but I want this new component to mirror the functionality of SelectOneRadio, and the only different is that it will use my Renderer. Do I need to create both custom tag and custom component to go with my custom renderer in this case? What class should I extends to obtain all functionalities from SelectOneRadio? I would greatly appreciated if you can provided some codes.

EDIT
@BalusC: I like your idea about detecting the value of layout to delegate the correct renderer. So if I have layout=”div_layout”, then it works great, but if it is pageDirection or lineDirection and nothing show up. What I did is: I create a class that extends MenuRenderer and I override encodeEnd method, so in there I did this

String layout = (String) component.getAttributes().get("layout");

if(layout != null){
        if(layout.equals(PAGE_DIRECTION) || layout.equals(LINE_DIRECTION)){
            super.encodeEnd(context, component);
            return;
        } else if (!layout.equals(DIV_LAYOUT)){
            //Throw error message
        }
}
//Continue with my own renderer code

EDIT2
Above when I said nothing show up, I was wrong. super.encodeEnd(context, component); did render, but instead of render the radio, it render select option tag. So it seems that I delegate to the wrong renderer. I need to use RadioRenderer instead of MenuRenderer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:27:28+00:00Added an answer on June 7, 2026 at 4:27 am

    If it’s specific to your own web application, then you could replace just alone the renderer. Easiest is to extend the implementation specific renderer and then depending on the value of one of the standard attributes (layout is the best choice) either delegate to the implementation specific renderer, or do your own custom rendering job.

    I case of Mojarra, you’d like to extend com.sun.faces.renderkit.html_basic.RadioRenderer and then register it as follows

    <renderkit>
        <renderer>
            <component-family>javax.faces.SelectOne</component-family>
            <renderer-type>javax.faces.Radio</renderer-type>
            <renderer-class>com.example.ExtendedRadioRenderer</renderer-class>
        </renderer>
    </renderkit>
    

    If you wish to be implementation independent, then you’d need to write the entire renderer implementation yourself.

    If you wish to have a custom component for it, then you’d need to write it yourself as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My form validation works great, but the messages use the JSF component name and
I have written a custom component for jsf. The renderer extends com.sun.faces.renderkit.html_basic.ListboxRenderer. My component
We have a custom JSF component that renders some buttons and a select box
Is it possible to call another JSF component from within a custom component (as
I'm writting a custom JSF component that will render image transitions for a set
I am enhancing an existing JSF app. There I need to add ExtGWT component
Let's consider that I want to extend an existing JSF component, such as the
Can i somehow add JSF tags to my JSF component renderer class? I'm trying
Is there a JSF component which can take a collection of items and render
I am developing a custom component using JSF 1.2. My tag class extends UIComponentELTag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.