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 7679551
In Process

The Archive Base Latest Questions

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

I am trying to make ajax requests in my project, but I do not

  • 0

I am trying to make ajax requests in my project, but I do not succeed.

I have created a xhtml page with a selectoneradio that I want to use AJAX to render a panelgrid.

<h:selectOneRadio id="tcliente" value="#{clienteMB.tipoCliente}">
  <f:ajax execute="@form" render="sessaoDados" listener=#{cadastroClienteRendererMB.testar}" />
  <f:selectItems value="#{clienteMB.itemValuesTipoCliente}" />
</h:selectOneRadio>

My managedbean:

@ManagedBean<br>
@ViewScoped<br>
public class CadastroClienteRendererMB implements Serializable {<br>
...
public void testar() {

    System.out.println("teste");

    if (panel == null)
        panel = new HtmlPanelGrid();

    HtmlOutputText text = new HtmlOutputText();

    text.setValue("teste");

    panel.getChildren().add(text);

  }
}

I googled for this issue, but all the answers that I am following are not solving this. And the last question that I consulted is this:
valueChangeListener is not getting called from <h:selectOneRadio> which is placed in side a <h:panelGrid>

Please, sorry, is the first time to use this forum and I am needing some help or orientation about this.

Thanks and regards

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

    Strictly answering your question, you don’t need to create a UIComponent instance in your controller like you did in your code to get ajax to work.

    Calling f:ajax will cause the setter for your controller property to be called on the event you’ve specified. If you do not specify any event, the default event for that kind of UIComponent will be called. For h:selectOneRadio it is valueChange event.

    Anyway you need to provide a proper item value for f:selectItems. If the property you are setting is a string, the item value should be a string. If the property is a custom type you’ve defined you should create a converter in order to convert the value accordingly.

    In this test the value we’re setting is a string, so we don’t need a converter for it.

    I’ve created a small test application for you:

    Controller

    
    
        @ManagedBean
        @ViewScoped
        public class TestController implements Serializable
        {
            private static final long serialVersionUID = 1L;
    
            private String teste;
    
            public String getTeste()
            {
                return teste;
            }
    
            public void setTeste(String teste)
            {
                this.teste = teste;
            }
        }
    
    
    

    Page

    <h:form>
    
        <h:panelGrid id="meuGrid" columns="2">
    
            <h:outputText value="Servidor" />
            <h:selectOneRadio id="teste" value="#{testController.teste}">
                <f:selectItem itemLabel="JBoss AS7" itemValue="AS7" />
                <f:selectItem itemLabel="GlassFish" itemValue="GF3" />
                <f:ajax execute="@this" render="resultado" />
            </h:selectOneRadio>
    
            <h:outputText value="Selecionado" />
            <h:outputText id="resultado" value="#{testController.teste}" />
    
        </h:panelGrid>
    
    </h:form>
    

    That’s it.

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

Sidebar

Related Questions

I'm trying to make an AJAX call to a model that I have in
I am trying to make two ajax requests in parallel using jQuery like this:
I'm trying to make an ajax request recursively upon each success response that is
I'm trying to make an AJAX form that will update a twitter status when
I am trying to make an ajax call using $.get() where I want to
I'm trying to make an AJAX GET request, but I simply cannot get it
Alright, I'm trying to make an AJAX Chat system that polls the chat database
I am trying to make this ajax request function work but netbeans is giving
I have a chain of ajax requests that support a series of cascading drop
I'm trying to make an AJAX enabled web page using rails and jQuery. The

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.