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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:56:08+00:00 2026-06-14T14:56:08+00:00

I have a h:selectonemenu that is populated by a list. When a specific value

  • 0

I have a h:selectonemenu that is populated by a list. When a specific value is selected, a h:datatable should be rendered. When I select that “specific” value, the h:datatable does not render until I refresh the page. What am I doing wrong?

<tr class="portlet-table-body" >
    <td width="20%" class="porlet-padding-left"><h:outputText value="${operatorProgramBundle.NextGenerationWorkflow}" /></td>
    <td width="450px">
        <h:selectOneMenu id="ngw" styleClass="portlet-dropdown"  value="${CRUDOperatorProgram.selectedNextGenWorkflow}">
            <f:selectItems value="${CRUDOperatorProgram.nextGenWorkflowList}" />
            <a4j:support event="onchange" ajaxsingle = "true" reRender="customTable" ></a4j:support>  
        </h:selectOneMenu>
    </td>
</tr>



<h:panelGroup id="customTable">
<h:dataTable id="DispatchConfigurationCustom" columnClasses="portlet-table-same portlet-table-cell"
    headerClass="portlet-table-same portlet-table-cell" value="#{CRUDOperatorProgram.workflowConfigList}" var="workflowConfig" width="100%" rendered="#{CRUDOperatorProgram.selectedNextGenWorkflow == 0}">
    <h:column>
        <f:facet name="header">
            <h:outputText value="Include" />
        </f:facet>
        <h:selectBooleanCheckbox id="includeInd" value="#{workflowConfig.isIncludedInd}"/>
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Automate" />
        </f:facet>
        <h:selectOneRadio id="onOff" value="#{workflowConfig.isAutomatedInd}">
            <f:selectItem id="onButton" itemLabel="On" itemValue="0" />
            <f:selectItem id="offButton" itemLabel="Off" itemValue="0" />
        </h:selectOneRadio>
    </h:column>
</h:dataTable>
</h:panelGroup> 

Updated Code:

<tr class="portlet-table-body" >
    <td width="20%" class="porlet-padding-left"><h:outputText value="${operatorProgramBundle.NextGenerationWorkflow}" /></td>
    <td width="450px">
        <h:selectOneMenu id="ngw" styleClass="portlet-dropdown"  value="#{CRUDOperatorProgram.selectedNextGenWorkflow}" valueChangeListener="#{CRUDOperatorProgram.nextGenWorkflowChanged}">
            <f:selectItems value="#{CRUDOperatorProgram.nextGenWorkflowList}" />
            <a4j:support event="onchange" reRender="customTable"></a4j:support>  
    </h:selectOneMenu>
    </td>
</tr>

<h:panelGroup id="customTable">
<h:dataTable id="DispatchConfigurationCustom" columnClasses="portlet-table-same portlet-table-cell"
    headerClass="portlet-table-same portlet-table-cell" value="#{CRUDOperatorProgram.workflowConfigList}" var="workflowConfig" width="100%">
    <h:column>
        <f:facet name="header">
            <h:outputText value="Include" />
        </f:facet>
        <h:selectBooleanCheckbox id="includeInd" value="#{workflowConfig.isIncludedInd}"/>
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Automate" />
        </f:facet>
        <h:selectOneRadio id="onOff" value="#{workflowConfig.isAutomatedInd}">
            <f:selectItem id="onButton" itemLabel="On" itemValue="0" />
            <f:selectItem id="offButton" itemLabel="Off" itemValue="0" />
        </h:selectOneRadio>
    </h:column>
    </h:dataTable>
</h:panelGroup>

Back Bean (Relevant parts) …

private List<WorkflowConfig> workflowConfigList = new ArrayList<WorkflowConfig>();
private List<SelectItem> nextGenWorkflowList;

public void nextGenWorkflowChanged(ValueChangeEvent event) {

    workflowConfigList.clear();
    //the value is a long, so make it a string and check
    if(event.getNewValue() != null && event.getNewValue().toString().equals("0")){
        loadWorkFlowConfigs();
    }else{
        //Do not show the datatable
        workflowConfigList.clear();
    }   
}
public List<WorkflowConfig> getWorkflowConfigList(){

    return this.workflowConfigList;
}
private void loadWorkFlowConfigs() {

    Query query = em.createNamedQuery("findAllWorkflowSteps");
    List<WorkflowStep> step = (List<WorkflowStep>) query.getResultList();

    for(WorkflowStep workflowStep : step){
        WorkflowConfig workflowConfig = new WorkflowConfig();
        workflowConfig.setWorkflowStep( workflowStep );
        workflowConfigList.add(workflowConfig);
    }
}

I implemented a valueChangeListener like you said. I tried this example (with the h:panelGroup) and the example without a h:panelGroup explained in the documentation. Each require a page refresh… Can you see anything I’m doing wrong?

  • 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-14T14:56:09+00:00Added an answer on June 14, 2026 at 2:56 pm

    Change the behavior of the <a4j:support> component by adding adding the action=#{someBean.someMethod} tag attribute or add a valueChangeListener in your <h:selectOneMenu>. IMO, I preffer to add a valueChangeListener. See the example in the official documentation.

    As a side note, why you use ${...} instead of #{...}?

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

Sidebar

Related Questions

Hi I have the follonwing selectOneMenu <h:selectOneMenu value=#{modelsController.selected.idBrands}> <f:selectItems value={brandsController.itemsAvailableSelectOne} /> </h:selectOneMenu> <br/> which
I have a selectOneMenu that displays some different stuff categories: <h:selectOneMenu value=#{searchController.selectedCategory}> <f:selectItems value=#{searchController.formatedCategories()}
I have a <h:selectOneMenu> that renders the value of the cardStatus from my object
I have a situation where there is a selectOneMenu that has a value bound
I have this selectOneMenu that asks for something, the default value is empty, because
I have a small piece of code that produce PrimeFaces dropdown List p:selectOneMenu ,
I have this menu: <h:selectOneMenu value=#{ApplicationController.settings['SessionTTL']}> <f:selectItem itemValue=60 itemLabel=1 hour /> <f:selectItem itemValue=30 itemLabel=30
I have a selectOneMenu that manages a relation between two Objects A and B.
I have a dataTable which has a value of a bean class which looks
I want to have multiple <h:selectOneMenu> that are displayed by selection of main <h:selectOneMenu>

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.