4 Replies Latest reply on Jun 12, 2008 12:37 PM by leandro godoy

    Problems with (a4j:support)

    leandro godoy Apprentice

      Hello staff, I am having problems with (a4j: suport) in a (selectOneMenu) see the code:

      <h:panelGrid columns="2" width="521">
       <h:outputText value="#{msg.estado}"></h:outputText>
       <h:panelGroup>
       <h:selectOneMenu value="#{fornecedor.fornecedor.estado}" styleClass="rich-select"
       id="comboestado" style=" width : 194px;">
       <f:selectItems value="#{Cidade.estadoidsForValue}"/>
       <a4j:support event="onchange" action="#{fornecedor.carregaCidades}"
       ajaxSingle="true" reRender="combocidadegrupo" >
       </a4j:support>
       <f:param value="#{cliente.cliente.estado}" name="Pestado" />
       </h:selectOneMenu>
      
       <a4j:commandLink style="cursor:pointer" actionListener="#{Estado.Novo}" immediate="true"
       ajaxSingle="true" ignoreDupResponses="true" reRender="comboestado"
       oncomplete="Richfaces.showModalPanel('loadEstado',{width:450, top:200})">
       <h:graphicImage value="/images/newButtons/add.png" width="20"
       height="20" style="border:0" styleClass="imagem"></h:graphicImage>
       </a4j:commandLink>
       </h:panelGroup>
      
      
      
       <h:outputText value="#{msg.cidade}"rendered="#{fornecedor.habilitacomboCidade}"></h:outputText>
       <a4j:outputPanel id="combocidades" rendered="#{fornecedor.habilitacomboCidade}" >
      
       <h:panelGroup id="combocidadegrupo">
       *<h:selectOneMenu value="#{fornecedor.fornecedor.cidadeid}" id="combocidade" >
       <f:selectItems value="#{fornecedor.cidadeids}"/>
       <f:converter converterId="cidadeconversor" />
       </h:selectOneMenu>
       <a4j:commandLink style="cursor:pointer" actionListener="#{Cidade.Novo}" immediate="true"
       ajaxSingle="true" ignoreDupResponses="true" reRender="combocidadegrupo"
       oncomplete="Richfaces.showModalPanel('loadCidade',{width:450, top:200})">
       <h:graphicImage value="/images/newButtons/add.png" width="20"
       height="20" style="border:0" styleClass="imagem"></h:graphicImage>
       </a4j:commandLink>
      
       </h:panelGroup>
       </a4j:outputPanel>
       </h:panelGrid>
      


      What happens is that the selectOneMenu which contains the cities did not and when I rendered the selection of a state, but if I make a submit the form renders it, how can I solve this?
      Thank you, hugging.

        • 1. Re: Problems with (a4j:support)
          leandro godoy Apprentice

          please,help me :(

          • 2. Re: Problems with (a4j:support)
            leandro godoy Apprentice

            Have resolve this:

            
            *<h:selectOneMenu value="#{cliente.cliente.estado}" styleClass="rich-select"
             id="comboestado">
             <f:selectItems value="#{Cidade.estadoidsForValue}"/>
             <a4j:support event="onchange" action="#{cliente.carregaCidades}"
             ajaxSingle="true" reRender="combocidades" >
             </a4j:support>
             <f:param value="#{cliente.cliente.estado}" name="Pestado" />
             </h:selectOneMenu>
            
             <a4j:commandLink style="cursor:pointer" actionListener="#{Estado.Novo}" immediate="true"
             ajaxSingle="true" ignoreDupResponses="true" reRender="comboestado"
             oncomplete="Richfaces.showModalPanel('loadEstado',{width:450, top:200})">
             <h:graphicImage value="/images/newButtons/add.png" width="20"
             height="20" style="border:0" styleClass="imagem"></h:graphicImage>
             </a4j:commandLink>
            
             <rich:spacer width="14"></rich:spacer>
             <h:outputText value="#{msg.cidade}"rendered="#{cliente.habilitacomboCidade}"></h:outputText>
             <a4j:outputPanel id="combocidades" ajaxRendered="true" >
            
             <h:panelGroup id="combocidadegrupo">
             *<h:selectOneMenu value="#{cliente.cliente.cidadeid}" rendered="#{cliente.habilitacomboCidade}" id="combocidade" >
             <f:selectItems value="#{cliente.cidadeids}"/>
             <f:converter converterId="cidadeconversor" />
             </h:selectOneMenu>
             <a4j:commandLink style="cursor:pointer" actionListener="#{Cidade.Novo}" immediate="true"
             ajaxSingle="true" ignoreDupResponses="true" reRender="combocidadegrupo"rendered="#{cliente.habilitacomboCidade}"
             oncomplete="Richfaces.showModalPanel('loadCidade',{width:450, top:200})">
             <h:graphicImage value="/images/newButtons/add.png" width="20"
             height="20" style="border:0" styleClass="imagem"rendered="#{cliente.habilitacomboCidade}">
             </h:graphicImage>
             </a4j:commandLink>
            
             </h:panelGroup>
             </a4j:outputPanel>
             <rich:spacer width="14"></rich:spacer>
             <h:outputText value="#{msg.situacao}"></h:outputText>
             *<h:selectOneMenu>
             <f:selectItem itemValue="#{msg.ativo}" itemLabel="#{msg.ativo}" />
             <f:selectItem itemValue="#{msg.ativo}" itemLabel="#{msg.inativo}" />
             </h:selectOneMenu>
            
             </h:panelGroup>
             </h:panelGrid>
            
            


            • 3. Re: Problems with (a4j:support)
              Sergey Smirnov Master

              It does not look like you say what RichFaces version do you use.

              • 4. Re: Problems with (a4j:support)
                leandro godoy Apprentice

                 

                "SergeySmirnov" wrote:
                It does not look like you say what RichFaces version do you use.


                Do not understand what you said ...?, I use the richFaces version 3.2.1 with jsf 1.2
                described the problem was solved by putting my SelectOneMenu within one (<a4j: outputPanel) now this rendering correctly.
                thanks.