+ Start a Discussion
AK2017AK2017 

action:support in selectradio is not rendering the output panel

Hello.

I am trying to call a apex method and rerender a small section when radio button is changed but it is working. can anyone suggest me what wrong i am doing it here.

If i rerender it is working fine but i don't want to rerender because it has password field and rerendering makes those fields blanks.

Please suggest me an idea.
 
<apex:page controller="apexcontroller">

 <apex:outputPanel id="page">
   <div class="step selected">
<apex:outputPanel rendered="{!NewUser==true}">
             
              <div class="Container">         
             
               
                    
              <apex:outputPanel id="additional">             
             
              <div>
                <h4>Address details</h4>
               </div>
                <div class="form-group row">
                   
                                <div class="col-md-4 col-lg-3">   
                                   <label for="PrimaryAdrress1" >Address 1*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_Street_1__c}"  id="PrimaryAdrress1" type="text" html-placeholder="Address 1" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-2">   
                                   <label for="PrimaryAdrress2" >Address 2*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_Street_2__c}"  id="PrimaryAdrress2" type="text" html-placeholder="Address 1" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-2">   
                                   <label for="PrimaryCity" >City*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_City__c}"  id="Primarycity" type="text" html-placeholder="City" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-1">   
                                   <label for="PrimaryState" >State*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_State__c}"  id="PrimaryState" type="text" html-placeholder="State" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-1">   
                                   <label for="PrimaryZip" >Zip Code*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_Postal_Code__c}"  id="Primaryzip" type="text" html-placeholder="Zip" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-3">   
                                   <label for="PrimaryCountry" >Country*</label>
                                <div>
                                   <apex:inputField value="{!account.Primary_Country__c}"  id="Primarycountry" type="text" html-placeholder="Country" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                           
                
                </div>
                 <div class="form-group row">
                     <div class="col-md-8 col-lg-4 col-xs-8"> 
                         
                         <p>Is the Mailing Address same as the Primary Address?*</p> 
                     </div>
                     <div class="col-md-4 col-lg-6 col-xs-4">                                                   
                          <apex:selectRadio value="{!useprimaryasmailing}" id="sameAddresses" >
                                   <apex:selectOptions value="{!usePrimaryAsShippingValues}" />
                                   <apex:actionSupport event="onchange" action="{!updateShipping}" reRender="addresses"/>
                          </apex:selectRadio>                        
                      </div>                    
                
             </div>
             
             <apex:outputPanel id="addresses">
                     <div class="form-group row">
                    
                                <div class="col-md-4 col-lg-3">   
                                   <label for="MailingAdrress1" >Address 1*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_Street_1__c}"  id="MailingAdrress1" type="text" html-placeholder="Address 1" style="width:100%;" styleClass="form-control"/>
                                   <script>document.getElementById('{!$Component.MailingAdrress1}').disabled = {!disableInput}; </script>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-2">   
                                   <label for="MailingAdrress2" >Address 2*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_Street_2__c}"  id="MailingAdrress2" type="text" html-placeholder="Address 1" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-2">   
                                   <label for="MailingCity" >City*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_City__c}"  id="Mailingcity" type="text" html-placeholder="City" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-1">   
                                   <label for="MailingState" >State*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_State__c}"  id="MailingState" type="text" html-placeholder="State" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-1">   
                                   <label for="MailingZip" >Zip Code*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_Postal_Code__c}"  id="Mailingzip" type="text" html-placeholder="Zip" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                               <div class="col-md-4 col-lg-3">   
                                   <label for="MailingCountry" >Country*</label>
                                <div>
                                   <apex:inputField value="{!account.Shipping_Country__c}"  id="Mailingcountry" type="text" html-placeholder="Country" style="width:100%;" styleClass="form-control"/>
                                </div>
                              </div> 
                           
                
                </div>
                </apex:outputPanel> 
               </apex:outputPanel>  
             </div>             
            
             </apex:outputPanel> 
             </div>
             </apex:outputPanel>


             
Rohit B ☁Rohit B ☁
If you want to rerender some specific part then you can use apex:actionRegion then it will apply ajax only on this region. Or simply if you want to re-render a specific part then put a outer output panel and then re-render this outer output panel. It should work..