5 Replies Latest reply on Jan 20, 2011 5:18 PM by ilya40umov

    No update done in selectOneMenu values.

    dolos

      Hi everybody and thanks in advance for helping me. I have an app with a rich:TabPanel wich contains 2 forms and 5 included JSP's in 7 tabs. There are no nested forms, but I'm having a problem with one of the forms. This forms contains 3 selectOneMenu, representing a hierarchy of clasifications, so when the user changes the value of the first selectOneMenu, the other two should change acordding to the selected value. To do this I'm using a4j:support tags with the onchange event, calling some methods that will obtain the corresponding values from database and set them into a ArrayList of SelectItems. Everything works ok in my localhost, and my test server, but in the production server the selectOneMenu's dosn't change. I have made many modifications trying to solve it but it's still not working just in that server, any idea to make it work? Here's a part of my code:

       

       

      <rich:tab label="Ubicación PMD" disabled="#{not DetalleProgramaProyectoBean.subprograma}" 
      id="tabUbicacion" switchType="client">
      <a4j:form prependId="false" ajaxSubmit="true">
      <a4j:loadBundle basename="com.copladem.utils.lineamientos" var="lineamientos"/>
      <h:panelGrid columns="2">
      <a4j:commandLink oncomplete="#{rich:component('modalLineamientos')}.show()" 
                 reRender="lineamiento">
      <h:graphicImage alt="?" style="border: 0px" value="/resources/Iconos/help.png"/>
      <f:setPropertyActionListener target="#{DetalleProgramaProyectoBean.msjLineamientos}"
      value="#{lineamientos.ubicacion}"/>
      </a4j:commandLink>
      <h:outputText id="nppUbicacion" style="font-weight: bold" value="Programa/Proyecto: #{DetalleProgramaProyectoBean.programa.nombre}"/>
      </h:panelGrid>
      <h:panelGrid columns ="2">
      <h:outputText value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion1}"
      style="font-weight: bold"/>
      <h:outputText value="#{DetalleProgramaProyectoBean.strClas1}"
      rendered="#{not LoginBean.programaEdicion}"/>
      <h:selectOneMenu id="cmbClas1" rendered="#{LoginBean.programaEdicion}"
      value="#{DetalleProgramaProyectoBean.clasificacion1}">
      <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones1}"/>
      <a4j:support action="#{DetalleProgramaProyectoBean.cargaCMBClasificacion2}"
      event="onchange" ajaxSingle="true" oncomplete="generaClave();"
      reRender="panelClas2,panelClas3"/>
      </h:selectOneMenu>
      <h:outputText style="font-weight: bold"
      value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion2}"/>
      <h:outputText value="#{DetalleProgramaProyectoBean.strClas2}"
      rendered="#{not LoginBean.programaEdicion}"/>
      <a4j:outputPanel id="panelClas2" rendered="#{LoginBean.programaEdicion}">
      <h:selectOneMenu id="cmbClas2" rendered="#{LoginBean.programaEdicion}"
      value="#{DetalleProgramaProyectoBean.clasificacion2}" immediate="true">
      <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones2}"/>
      <a4j:support action="#{DetalleProgramaProyectoBean.cargaCMBClasificacion3}"
      event="onchange" reRender="panelClas3" ajaxSingle="true"
      oncomplete="generaClave();"/>
      </h:selectOneMenu>
      </a4j:outputPanel>
      <h:outputText style="font-weight: bold"
      value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion3}"/>
      <h:outputText value="#{DetalleProgramaProyectoBean.strClas3}"
      rendered="#{not LoginBean.programaEdicion}"/>
      <a4j:outputPanel id="panelClas3" rendered="#{LoginBean.programaEdicion}">
      <h:selectOneMenu id="cmbClas3" rendered="#{LoginBean.programaEdicion}"
      value="#{DetalleProgramaProyectoBean.clasificacion3}" immediate="true">
      <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones3}"/>
      <a4j:support action="#{DetalleProgramaProyectoBean.GeneraClave}" event="onchange"
      reRender="txtClave"/>
      </h:selectOneMenu>
      </a4j:outputPanel>
      </h:panelGrid>
      </a4j:form>
      </rich:tab>
      
      
        • 1. No update done in selectOneMenu values.
          ilya40umov

          If something works fine somewhere and doesn't work in another place it seems to be an issue in a configuration/enviroment but not in code.

          Try to add as many debug messages as it possible and then try this code on server. This log can really help to understand what's exacly wrong with your app when it's deployed on a server.

          Try to identify differences between your server and production server(java version, OS, app server, jars, configs etc)

          1 of 1 people found this helpful
          • 2. No update done in selectOneMenu values.
            dolos

            I have checked the enviroment of the other server and I can se just 2 major differences: we are using Ubuntu 10.04, the other server is Ubuntu 8.04; we use glassfish v2.1, the other server uses Glassfish Sun Java System Application Server 9.1_01.

            So the other server is not updated, is there any known issue with this versions of Ubuntu or glassfish? Thanks in advance for any help

            • 3. No update done in selectOneMenu values.
              ilya40umov

              I suppose that your problem could be in Glassfish on this server(Because I think that "Glassfish Sun Java System Application Server 9.1_01" is an earlier version than GF v2.1). So probably you should try to install GlassFish 2.1 on this server. Or at least update JSF implementation to the latest.

              1 of 1 people found this helpful
              • 4. Re: No update done in selectOneMenu values.
                dolos

                After several attempts, I found a way to make it works without changing the glassfish server, now we use a4j:jsFunction's to do the work that originally was done using a4j:support's, I don't know what is the difference behind it, but now it's working in glassfish v2.1 and 9.1. Here is the new code:

                 

                <rich:tab label="Ubicación PMD" disabled="#{not DetalleProgramaProyectoBean.subprograma}"
                id="tabUbicacion" switchType="client">
                <a4j:form prependId="false">
                <a4j:jsFunction action="#{DetalleProgramaProyectoBean.GeneraClave}" name="genKey" 
                reRender="txtClave"/>
                <a4j:jsFunction action="#{DetalleProgramaProyectoBean.cargaCMBClasificacion2}"
                ajaxSingle="true" name="cambioClas1" process="cmbClas1" oncomplete="genKey();" 
                reRender="cmbClas2,cmbClas3"/>
                <a4j:jsFunction action="#{DetalleProgramaProyectoBean.cargaCMBClasificacion3}" ajaxSingle="true"
                name="cambioClas2" process="cmbClas2" oncomplete="genKey();" reRender="cmbClas3"/>
                <a4j:loadBundle basename="com.copladem.utils.lineamientos" var="lineamientos"/>
                <h:panelGrid columns="2">
                <a4j:commandLink oncomplete="#{rich:component('modalLineamientos')}.show()" 
                reRender="lineamiento">
                <h:graphicImage alt="?" style="border: 0px" value="/resources/Iconos/help.png"/>
                <f:setPropertyActionListener target="#{DetalleProgramaProyectoBean.msjLineamientos}"
                value="#{lineamientos.ubicacion}"/>
                </a4j:commandLink>
                <h:outputText id="nppUbicacion" style="font-weight: bold"
                value="Programa/Proyecto: #{DetalleProgramaProyectoBean.programa.nombre}"/>
                </h:panelGrid>
                <h:panelGrid columns ="2">
                <h:outputText value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion1}"
                style="font-weight: bold"/>
                <h:outputText value="#{DetalleProgramaProyectoBean.strClas1}" 
                rendered="#{not LoginBean.programaEdicion}"/>
                <h:selectOneMenu id="cmbClas1" rendered="#{LoginBean.programaEdicion}"
                value="#{DetalleProgramaProyectoBean.clasificacion1}" onchange="cambioClas1();">
                <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones1}"/>
                </h:selectOneMenu>
                <h:outputText style="font-weight: bold"
                value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion2}"/>
                <h:outputText value="#{DetalleProgramaProyectoBean.strClas2}"
                rendered="#{not LoginBean.programaEdicion}"/>
                <h:selectOneMenu id="cmbClas2" rendered="#{LoginBean.programaEdicion}"
                value="#{DetalleProgramaProyectoBean.clasificacion2}" onchange="cambioClas2();">
                <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones2}"/>
                </h:selectOneMenu>
                <h:outputText style="font-weight: bold"
                value="#{DetalleProgramaProyectoBean.programa.pdm.nombreClasificacion3}"/>
                <h:outputText value="#{DetalleProgramaProyectoBean.strClas3}"
                rendered="#{not LoginBean.programaEdicion}"/>
                <h:selectOneMenu id="cmbClas3" rendered="#{LoginBean.programaEdicion}"
                value="#{DetalleProgramaProyectoBean.clasificacion3}" onchange="genKey();">
                <f:selectItems value="#{DetalleProgramaProyectoBean.clasificaciones3}"/>
                </h:selectOneMenu>
                </h:panelGrid>
                </a4j:form>
                </rich:tab>
                
                

                 

                I hope it can help somebody else and thanks for your help

                • 5. Re: No update done in selectOneMenu values.
                  ilya40umov

                  You are welcome and thank you very much for posting the final solution here. =)