function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alx MrAlx Mr 

reRender attribute does not work onChange of SelectOptions box

Hello.

reRender attribute does not work at all. Even when blank outputPanel (nothing inside the container) used.
This is the only element which is rerendered on the page. What can be the problem?
The paragraphs are rendered correctly on Load, 'rerender' results in general error on page.
<p> 
<apex:outputPanel>                                                   
   <apex:selectList value="{!lSoftware}" size="1" multiselect="false" >
           <apex:selectOptions value="{!SoftwareMulti}"/>
           <apex:actionSupport event="onchange" reRender="f3"/>
   </apex:selectList>                              
</apex:outputPanel>

</p>  
                                                        
<p>Database<br/>                             
    <apex:outputPanel>
          <apex:selectList value="{!lDataBase}" size="1" id="f3">
              <apex:selectOptions value="{!DataBase2Multi}"/>                                                        
          </apex:selectList>
    </apex:outputPanel>                                                      
   </p>
public List<SelectOption> getDataBase2Multi(){ 
       List<SelectOption> lSO_DataBases = new List<SelectOption>();
       ldatabase = '';
       return lSO_DataBases;
}
Even the most basic scenario causing the issue.
I used same methods on the page when new record created worked fine as well, when existing record loaded to be updated there is always an issue.
Can you advise on possible reasons, please. Why reRender attribute is not binded properly on the page?
 
Prateek Singh SengarPrateek Singh Sengar
Hi Alex,
Can you try rerendering the parent container. In this case please add an id to the outputpanel surronding the selectlist and try re-rendering it instead of the selectlist element.
 
Alx MrAlx Mr
Thank you for your prompt reply, Prateek.
<apex:outputPanel id="f3">
 </apex:outputPanel>  
i changed the 2nd paragraph to the most primitive way. Same error is still fired. 
Prateek Singh SengarPrateek Singh Sengar
Hi Alex,
When is your getDataBase2Multi called? Just by looking at it i think your code should be
 
<p> 
<apex:outputPanel>                                                   
   <apex:selectList value="{!lSoftware}" size="1" multiselect="false" >
       <apex:actionSupport event="onchange" reRender="f3" action="{!getDataBase2Multi}"/>
       <apex:selectOptions value="{!SoftwareMulti}"/>
   </apex:selectList>                              
</apex:outputPanel>

</p>  
                                                        
<p>Database<br/>                             
    <apex:outputPanel id="f3">
          <apex:selectList value="{!lDataBase}" size="1" >
              <apex:selectOptions value="{!DataBase2Multi}"/>                                                        
          </apex:selectList>
    </apex:outputPanel>                                                      
   </p>
Notice the changes 
1) added action method for actionsupport
2) moved the id from selectoptions to outputpanel.

If this doesnt work let me know, i will try with a simple example of rerender using picklist and paste the code for your reference.
 
Alx MrAlx Mr
Still didn't work.
<p>Software<br/>
   <apex:outputPanel>                                                   
        <apex:selectList value="{!lSoftware}" size="1" multiselect="false" >
            <apex:selectOptions value="{!SoftwareMulti}"/>
            <apex:actionSupport event="onchange" reRender="f3" action = "{!getDataBase2Multi}" />
        </apex:selectList>                              
   </apex:outputPanel>
  
</p>  
                                                        
<p>Database<br/>
   <apex:outputPanel id="f3">
        <apex:selectList value="{!lDataBase}" size="1">
             <apex:selectOptions value="{!DataBase2Multi}"/>                                                        
        </apex:selectList>
   </apex:outputPanel>
</p>
This is my complete modified code version. Same 'Authorization Required ' error.
 
Alx MrAlx Mr
Apex class: 
public List<SelectOption> getDataBase2Multi(){
          List<SelectOption> lSO_DataBases = new List<SelectOption>();
          ldatabase = '';
       	  lSO_DataBases.add(new SelectOption('',''));
          return lSO_DataBases;
    }

 
Prateek Singh SengarPrateek Singh Sengar
Hi Alex,
By any chance are you using this page on salesforce sites? or this is a page for internal users. Can you also share the error screenshot
Alx MrAlx Mr
This is public page for remote users. Its not the salesforce dedicated user page.
I pass id parameters in address line and every public user having unique link can submit application, and thus create/update records in salesforce db.
Alx MrAlx Mr
i used the same method when record was not created, and user submits data for the first time. If the existing record data is retrieved the method does not work. My guess is some kind of restriction for public access.
 
Prateek Singh SengarPrateek Singh Sengar
Hi Alex,
Please refer to the below link and try out the steps mentioned here to debug the issue. Since its a public page its very hard to pinpoint the issue by looking at the code. 
http://www.tgerm.com/2010/10/debugging-sites-authorization-required.html