1 Reply Latest reply on Nov 5, 2012 1:42 AM by Siva P

    a4j support problem

    Roberto Sorrenti Newbie

      Hello,

       

      i've a problem with refresh combobox values.

       

      i need to refresh the combobox's value when i select a day from my richcalendar, here is mi code:

       

      <rich:calendar id="data_rif" value="#{pl_voce_manuale.selectedDate}" datePattern="MM/dd/yy" mode="ajax" showInput="true" >

                              <!-- Customization with usage of facets and accessible elements -->

                                                                      <f:facet name="header">

                                                                          <h:panelGrid columns="2" width="100%" columnClasses="width100, fake">

                                                                              <h:outputText value="{selectedDateControl}" />

                                                                              <h:outputText value="{todayControl}"  style="font-weight:bold; text-align:left"/>

                                                                          </h:panelGrid>

                                                                      </f:facet>

                                                                      <f:facet name="weekDay">

                                                                          <h:panelGroup style="width:60px; overflow:hidden;" layout="block">

                                                                              <h:outputText value="{weekDayLabelShort}"/>

                                                                          </h:panelGroup>

                                                                      </f:facet>

                                                                      <f:facet name="weekNumber">

                                                                           <h:panelGroup>

                                                                              <h:outputText value="{weekNumber}" style="color:red"/>

                                                                          </h:panelGroup>

                                                                                 </f:facet>

                                                                       <f:facet name="footer">

                                                                          <h:panelGrid columns="3" width="100%" columnClasses="fake, width100 talign">

                                                                              <h:outputText value="{previousMonthControl}" style="font-weight:bold;"/>

                                                                              <h:outputText value="{currentMonthControl}" style="font-weight:bold;"/>

                                                                              <h:outputText value="{nextMonthControl}" style="font-weight:bold;"/>

                                                                          </h:panelGrid>

                                                                      </f:facet>

                                                                      <h:outputText value="{day}"></h:outputText>

       

      <a4j:support event="onchanged"  actionListener="#{pl_voce_manuale.leggiFolderCITCO}" reRender="descrizione_folder_dinamicoCITCO,prodotto_dinamicoCITCO,divisa_dinamicoCITCO,strategy_dinamicoCITCO" ajaxSingle="true" />

       

      </rich:calendar>

       

       

                                                        <h:panelGroup>

                                                                  <h:outputLabel value="Descrizione Folder : " style="display: block;" />

                                                                  <rich:comboBox id="descrizione_folder_dinamicoCITCO" value="#{pl_voce_manuale.COD_FOLDER}"  selectFirstOnUpdate="false" defaultLabel="seleziona il folder" required="true" enableManualInput = "false" requiredMessage="Folder obbligatorio">

                                                                <f:selectItems value="#{pl_voce_manuale.elencoFolder}" />

                                                                     </rich:comboBox>

                                                                     <rich:message for="descrizione_folder_dinamicoCITCO" errorClass="errorMessage"/>

                                                           </h:panelGroup>

       

       

      <h:panelGroup>

                                                                  <h:outputLabel value="Descrizione Prodotto : " style="display: block;" />

      <rich:comboBox id="prodotto_dinamicoCITCO" value="#{pl_voce_manuale.COD_PRODOTTO}"  selectFirstOnUpdate="false" defaultLabel="seleziona il prodotto" enableManualInput = "false" required="true" requiredMessage="Descrizione Prodotto obbligatorio">-->

             <f:selectItems value="#{pl_voce_manuale.elencoProdotto}" />

                      

        </rich:comboBox>

                                                                     <rich:message for="prodotto_dinamicoCITCO" errorClass="errorMessage" />

                                                           </h:panelGroup>

       

      <h:panelGroup>

                                                                               <h:outputLabel value="Divisa : " style="display: block;" />

                                                                            <rich:comboBox id="divisa_dinamicoCITCO" value="#{pl_voce_manuale.COD_DIV}"  selectFirstOnUpdate="false" defaultLabel="seleziona la divisa" required="false" enableManualInput = "false" requiredMessage="Divisa obbligatorio">

                                                                          <f:selectItems value="#{pl_voce_manuale.elencoDivisa}" />

                                                                               </rich:comboBox>

                                                                               <rich:message for="divisa_dinamicoCITCO" errorClass="errorMessage"/>

                                                                     </h:panelGroup>

       

       

      ..................

       

       

       

       

       

      But when i change the data from calendar, refresh only one combobox, someone can help me? thanks. Sorry for my bed english.

       

      Roberto

        • 1. Re: a4j support problem
          Siva P Master

          Hi Roberto,

           

          Try adding <a4j:outputPanel with id attribute.

          if you like to reRender all the Combobox means do like below,

           

           

          <a4j:outputPanel id="panelOutput"/>

           

              

             <h:panelGroup>

                                                                      <h:outputLabel value="Descrizione Folder : " style="display: block;" />

                                                                      <rich:comboBox id="descrizione_folder_dinamicoCITCO" value="#{pl_voce_manuale.COD_FOLDER}"  selectFirstOnUpdate="false" defaultLabel="seleziona il folder" required="true" enableManualInput = "false" requiredMessage="Folder obbligatorio">

                                                                    <f:selectItems value="#{pl_voce_manuale.elencoFolder}" />

                                                                         </rich:comboBox>

                                                                         <rich:message for="descrizione_folder_dinamicoCITCO" errorClass="errorMessage"/>

                                                               </h:panelGroup>

           

           

          <h:panelGroup>

                                                                      <h:outputLabel value="Descrizione Prodotto : " style="display: block;" />

          <rich:comboBox id="prodotto_dinamicoCITCO" value="#{pl_voce_manuale.COD_PRODOTTO}"  selectFirstOnUpdate="false" defaultLabel="seleziona il prodotto" enableManualInput = "false" required="true" requiredMessage="Descrizione Prodotto obbligatorio">-->

                 <f:selectItems value="#{pl_voce_manuale.elencoProdotto}" />

                          

            </rich:comboBox>

                                                                         <rich:message for="prodotto_dinamicoCITCO" errorClass="errorMessage" />

                                                               </h:panelGroup>

           

          <h:panelGroup>

                                                                                   <h:outputLabel value="Divisa : " style="display: block;" />

                                                                                <rich:comboBox id="divisa_dinamicoCITCO" value="#{pl_voce_manuale.COD_DIV}"  selectFirstOnUpdate="false" defaultLabel="seleziona la divisa" required="false" enableManualInput = "false" requiredMessage="Divisa obbligatorio">

                                                                              <f:selectItems value="#{pl_voce_manuale.elencoDivisa}" />

                                                                                   </rich:comboBox>

                                                                                   <rich:message for="divisa_dinamicoCITCO" errorClass="errorMessage"/>

                                                                         </h:panelGroup>

           

          </a4j:outputPanel>

           

           

          Add the in the

          <a4j:support event="onchanged"  reRender="outputPanelID"...

          ---It will referesh all the combobox.....

           

          If you like to refresh only one combo box means just rerender only the first combobox id in the <a4j:support tags reRender attribute.

           

          Thanks,

          Siva