3 Replies Latest reply on Jul 9, 2010 6:24 PM by erdogan sari

    Setters not fired after partial rerender

    erdogan sari Newbie

      Hi guys,

       

      Before rerender setter is fired. But after rerender setter is not fired.

       

      I have two combobox. If first combobox(kategori) value is change, then second combobox("altkategori") suggestion values change. First select "kategori", after rerendering then select "altkategori". And then click "Process" command button. But "altkategori" value dont passed to bean. I debug the code, setter of "altkategori" (setAltkategori) is not fired. Before rerender setter is fired.

       

      I use richfaces 3.3 final jars. My bean's (sorgu)  scope is session.

       

       

      my facelet is:


          <h:form>
              <h:panelGrid id="headersorgu" columns="2">     
                               <rich:comboBox id="kategori"
                                  suggestionValues="#{sorgu.kategoriler}"
                                  selectFirstOnUpdate="false" defaultLabel="Enter some value"
                                  value="#{sorgu.kategori}">
                                  <a4j:support event="onchange" action="#{sorgu.kategoriChanged}" reRender="altkategori" />
                              </rich:comboBox>          
             
                              <rich:comboBox id="altkategori"
                                  suggestionValues="#{sorgu.altkategoriler}"
                                  defaultLabel="Enter some value"
                                  value="#{sorgu.altKategori}">
                              </rich:comboBox>              
              </h:panelGrid>

              <h:panelGrid columns="1" >
                  <a4j:commandButton value="Process" reRender="mainpanel"/>
              </h:panelGrid>

          </h:form>

       


          <ui:define name="rightcontent">

              <h:panelGrid columns="1">
                  <rich:panel id ="mainpanel">
                      <h:form id="metadataDetail">
                          <h:panelGrid>
                         
                              <rich:panel bodyClass="rich-laguna-panel-no-header">
                                  <h:outputText id="rep" value="Kategori:#{sorgu.kategori}"/>
                              </rich:panel>

       

                              <rich:panel bodyClass="rich-laguna-panel-no-header">
                                  <h:outputText id="rep3" value="Alt Kategori:#{sorgu.altKategori}"/>
                              </rich:panel>
                                         
                          </h:panelGrid>
                      </h:form>
                  </rich:panel>
              </h:panelGrid>
          </ui:define>

       

       

      My action code is:

       


          public String kategoriChanged() {

       

              if(this.kategori.equals("Beyaz Eşya")){
                  altkategoriler= new String[]{"Buzdolabı","Çamaşır Makinesi","Fırın"};
              }else if(this.kategori.equals("Küçük Mutfak Aletleri")){
                  altkategoriler=new String[]{"Blendar","Mutfak Robotu"};
              }else if(this.kategori.equals("Kişisel Bakım")){
                  altkategoriler=new String[]{"Tıraş Makinesi","Epilasyon"};
              }else{
                  altkategoriler=new String[]{};
              }
        
              return null;

          }

       

      Thanks for any help,