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

  • Home
  • SEARCH
  • 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 7679641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:55:29+00:00 2026-05-31T17:55:29+00:00

This is my xhtml code : <?xml version=’1.0′ encoding=’UTF-8′ ?> <!DOCTYPE html PUBLIC -//W3C//DTD

  • 0

This is my xhtml code :

 <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

  <h:head>
    <title>Custom Radio Test</title>
  </h:head>

  <h:body>

    <h:form id="mF" >

      <p:selectOneRadio id="ITRadioGrp" value="#{testBean.radioSelectedValue}" layout="custom">
        <f:selectItems value="#{testBean.selectItems}" />
      </p:selectOneRadio>

      <h:panelGrid columns="1">

        <ui:repeat id="vBGOF" value="#{testBean.groupOfFlights}" var="aFlight" varStatus="gofIndex">
          <p:radioButton for="ITRadioGrp" itemIndex="#{gofIndex.index}"/> #{aFlight}
        </ui:repeat>

      </h:panelGrid>

    </h:form>

  </h:body>

</html>

and this is the managed bean :

    package com.modern;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.model.SelectItem;
import java.util.*;

@ManagedBean
@RequestScoped
public class TestBean {

  private String radioSelectedValue;
  private String[] groupOfFlights;
  private List selectItems;

  public TestBean() {
    groupOfFlights = new String[]{"FlightOne", "FlightTwo", "FlightThree"};
  }

  public String[] getGroupOfFlights() {
    return groupOfFlights;
  }

  public void setGroupOfFlights(String[] groupOfFlights) {
    this.groupOfFlights = groupOfFlights;
  }

  public String getRadioSelectedValue() {
    return radioSelectedValue;
  }

  public void setRadioSelectedValue(String radioSelectedValue) {
    this.radioSelectedValue = radioSelectedValue;
  }

  // modified
  public List getSelectItems() {
    try {
      if (selectItems == null || selectItems.isEmpty()) {
        selectItems = new ArrayList();
        for (int g = 0; g < 3; g++) {
          SelectItem option = new SelectItem(g, "flight" + (g + 1)); // value, label
          selectItems.add(option);
        }
      }
    } catch (Exception e) {
      System.out.println(this.getClass().getName() + "] EXCEPTION " + e.toString());
    }
    return selectItems;
  }

  public void setSelectItems(List selectItems) {
    this.selectItems = selectItems;
  }
}

I always get the same error :

Cannot find component ‘mF:ITRadioGrp’ in view.

javax.faces.FacesException: Cannot find component 'mF:ITRadioGrp' in view.
    at org.primefaces.component.radiobutton.RadioButtonRenderer.findSelectOneRadio(RadioButtonRenderer.java:144)
    at org.primefaces.component.radiobutton.RadioButtonRenderer.encodeEnd(RadioButtonRenderer.java:35)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763)
    at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104)
    at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:513)
    at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:974)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
    at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
    at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

I’ve tried to change the “for” attribute in

<p:radioButton for="mF:ITRadioGrp" itemIndex="#{gofIndex.index}"/> #{aFlight}

to (i checked the HTML source deleting the layout=custom” in p:selectOneRadio) :

  1. mF:ITRadioGrp
  2. ITRadioGrp
  3. mF:ITRadioGrp:0
  4. mF:ITRadioGrp:1 …

but always same error!!
where i’m wrong???
Thanks!

  • 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-05-31T17:55:31+00:00Added an answer on May 31, 2026 at 5:55 pm

    Use a colon as prefix in order to address the p:selectOneRadio beginning from the view root:

    <p:radioButton for=":mF:ITRadioGrp" itemIndex="#{gofIndex.index}"/>
    

    If this does not work, look into the html source of your page in browser and find the correct client id for the p:selectOneRadio. Use this id in your for attribute.

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

Sidebar

Related Questions

I have the following code. <?xml version=1.0 encoding=UTF-8 standalone=no?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have this html doc: <?xml version=1.0 encoding=utf-8?><!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
This sample code won't pass w3c validator. <?xml version=1.0 encoding=UTF-8 ?> <!DOCTYPE html PUBLIC
Hi I got the following code: <?xml version=1.0 encoding=UTF-8 ?> <!DOCTYPE html PUBLIC -//W3C//DTD
I have document <?xml version=1.0 encoding=utf-8 ?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
This is My Code Default.aspx: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd>
I have this simple code in facelets numbers.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
this is my google-map code: <!DOCTYPE html PUBLIC -//WAPFORUM//DTD XHTML Mobile 1.0//EN http://www.wapforum.org/DTD/xhtml-mobile10.dtd> <html
This is my code in my managed bean :- <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE
Take a look at this example code, which doesn't work: <?xml version='1.0' encoding='UTF-8' ?>

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.