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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:41:21+00:00 2026-06-05T15:41:21+00:00

The basic idea is to enable the selectManyCheckbox when the selectBooleanCheckbox is not checked

  • 0

The basic idea is to enable the selectManyCheckbox when the selectBooleanCheckbox is not checked. When I first load the page and uncheck the selectBooleanCheckbox the rendering in ajax seems not to be working because the selectManyCheckbox remains disabled. How can I check what’s wrong? Or what am I missing?

This happens just when I first load the page, If I hit the button and play with the checkboxes suddenly it starts working.

Cheers,

    <h:form id="formActualizacionCubo">
        <rich:panel id="panelActualizacionCubo"
                    style="width: 350px">
            <f:facet name="header">
                <h:outputText value="Administracion Cubo de Información PEC"/>
            </f:facet>

            <h:outputLabel for="selectDependenciasCubo"
                           value="Actualizar TODO el Cubo de informacion?"/>
            <h:selectBooleanCheckbox id="selectDependenciasCubo"
                                     value="#{administrationBean.actualizaTodasDependencias}">
                <f:ajax event="click"
                        listener="#{administrationBean.doClearCuboLabels}"
                        render="opcionesDependenciasCubo seleccionDependencias messageActualizaCubo actualizacionCuboCorrecta"/>
            </h:selectBooleanCheckbox>

            <a4j:outputPanel id="opcionesDependenciasCubo">
                <h:selectManyCheckbox id="seleccionDependencias" 
                                      layout="pageDirection" required="true"
                                      requiredMessage="Seleccione al menos una dependencia."
                                      disabled="#{administrationBean.actualizaTodasDependencias}"
                                      value="#{administrationBean.dependenciasPorActualizar}">
                    <f:selectItems value="#{administrationBean.dependenciasOpciones}"/>
                    <f:ajax event="click"
                            listener="#{administrationBean.doClearCuboLabels}"
                            render="messageActualizaCubo actualizacionCuboCorrecta"/>
                </h:selectManyCheckbox>
                <rich:message id="messageActualizaCubo" 
                              for="seleccionDependencias"/>
            </a4j:outputPanel>
            <h:panelGrid columns="3">
                <a4j:commandButton id="btnActualizaCubo" value="Actualizar Cubo PEC"
                                   render="messageActualizaCubo actualizacionCuboCorrecta @this"
                                   onbegin="this.disabled=true;
                                   document.getElementById('formActualizacionCubo:imgProcesandoCubo').style.display='block'"
                                   oncomplete="this.disabled=false;
                                   document.getElementById('formActualizacionCubo:imgProcesandoCubo').style.display='none'"
                                   action="#{administrationBean.doActualizaCubo}"/>
                <h:panelGroup/>
                <h:graphicImage id="imgProcesandoCubo" url="img/imgLoading.gif"
                                style="display: none"/>
            </h:panelGrid>
            <a4j:outputPanel id="actualizacionCuboCorrecta" style="font-size: 14px; color: #D17100">
                <h:outputText rendered="#{administrationBean.actualizacionCuboCorrectaLabelRendered}"
                              value="Actualización correcta !"/>
                <h:outputText rendered="#{administrationBean.actualizacionCuboFalloLabelRendered}"
                              value="Fallo la actualización !"/>
            </a4j:outputPanel>
        </rich:panel>
    </h:form>

UPDATE

Post my Backing bean code, maybe you can find something wrong with it

private HashMap<String, String> dependencias;
private boolean actualizaTodoCuboChecked = true;
private List<String> dependenciasOpciones;
private List<String> dependenciasPorActualizar;
private boolean actualizacionCuboCorrectaLabelRendered = false;
private boolean actualizacionCuboFalloLabelRendered = false;

public boolean isActualizaTodoCuboChecked() {
    return actualizaTodoCuboChecked;
}

public void setActualizaTodoCuboChecked(boolean actualizaTodoCuboChecked) {
    this.actualizaTodoCuboChecked = actualizaTodoCuboChecked;
    dependenciasPorActualizar.clear();
}

public List<String> getDependenciasOpciones() {
    return dependenciasOpciones;
}

public void setDependenciasOpciones(List<String> dependenciasOpciones) {
    this.dependenciasOpciones = dependenciasOpciones;
}

public List<String> getDependenciasPorActualizar() {
    return dependenciasPorActualizar;
}

public void setDependenciasPorActualizar(List<String> dependenciasPorActualizar) {
    this.dependenciasPorActualizar = dependenciasPorActualizar;
}

public boolean isActualizacionCuboCorrectaLabelRendered() {
    return actualizacionCuboCorrectaLabelRendered;
}

public boolean isActualizacionCuboFalloLabelRendered() {
    return actualizacionCuboFalloLabelRendered;
}

public void doClearCuboLabels(){
    actualizacionCuboCorrectaLabelRendered = false;
    actualizacionCuboFalloLabelRendered = false;
}

public void doActualizaCubo() {
    if (actualizaTodoCuboChecked) {
        //Actualiza todas las dependencias
        //actualizacionCuboCorrectaLabelRendered = db.actualizarCuboInformacion(dependenciasOpciones);
    } else {
        //Actualiza solo las dependencias seleccionadas
        //actualizacionCuboCorrectaLabelRendered = db.actualizarCuboInformacion(dependenciasPorActualizar);
    }
    actualizacionCuboCorrectaLabelRendered = true; //Eliminar esta fila cuando se descomenten las llamadas en el IF-ELSE
    actualizacionCuboFalloLabelRendered = !actualizacionCuboCorrectaLabelRendered;
}

private void loadDependenciesFromXML() {
    XStream reader = new XStream(new DomDriver());
    reader.alias("root", Map.class);
    dependencias =
            (HashMap<String, String>) reader.fromXML(new File(ROOT_DIR + "/confFiles/dependencias.xml"));
    dependenciasOpciones = new ArrayList<String>();
    for (String s : dependencias.keySet()) {
        dependenciasOpciones.add(s);
    }
}
  • 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-05T15:41:22+00:00Added an answer on June 5, 2026 at 3:41 pm

    Finally after checking all my code step by step I realized that the two Lists were not initialized. So the problem got solved changing from this:

    private List<String> dependenciasOpciones;
    private List<String> dependenciasPorActualizar;
    

    to this

    private List<String> dependenciasOpciones = new ArrayList<String>();
    private List<String> dependenciasPorActualizar = new ArrayList<String>();
    

    and then everything worked perfect.

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

Sidebar

Related Questions

I have some basic idea on how to do this task, but I'm not
The basic idea is to create a page that gives the user the ability
The basic idea behind a Cancel button is to enable closing your window with
the basic idea is that you have some class that has a reference type
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I understand (I think) the basic idea behind RESTful-ness. Use HTTP methods semantically -
I have a basic implementation of alpha-beta pruning but I have no idea how
Basic question - is it possible to access the current Page from a static
The basic idea is that I have a family of classes that all do
The basic idea is very easy. Simplified you could say... a snake like line

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.