+ Start a Discussion
satakshisatakshi 

Refresh page after picklist value is change

Hello,

  I am writing code ehre i e=want to refresh page after picklist value is change. not when it is save. please help me to achieve this.
<apex:page controller="QBsampleCon" sidebar="false" showHeader="false" standardStylesheets="false">

<html>
<head>

            <div class="formFeildreport formFeild">
            <div class="feild formFeild">
       <!--<h2 style="color:black; "> Question Type:</h2> class="questionlabel"-->
             
             <label class="questionlabel" id="picvalchange">Question Type</label>

            <apex:selectList value="{!pickval}" multiselect="false" size="1" id="PickVal" styleClass="Picklist" label="Question Type:" ><br />
             <apex:actionSupport event="onchange" action="{!pickvalselect}" />   
            <apex:selectOptions value="{!SelectedOptions}"/>
            </apex:selectList><br /><br />
            
            </div>                 
          
Thanks & Regards,
Satakshi
 
Rowallim TechnologyRowallim Technology
Hi Satakshi
I suggest you to use this code, here i have used "rerender".
<apex:page controller="QBsampleCon" sidebar="false" showHeader="false" standardStylesheets="false">
 <apex:pageBlock id="id" >
<html>
<head>

            <div class="formFeildreport formFeild">
            <div class="feild formFeild">
       <!--<h2 style="color:black; "> Question Type:</h2> class="questionlabel"-->
             
             <label class="questionlabel" id="picvalchange">Question Type</label>

            <apex:selectList value="{!pickval}" multiselect="false" size="1" id="PickVal" styleClass="Picklist" label="Question Type:" ><br />
             <apex:actionSupport event="onchange" action="{!pickvalselect}" rerender="id" />   
            <apex:selectOptions value="{!SelectedOptions}"/>
            </apex:selectList><br /><br />
            
            </div>       
     </apex:pageBlock>   

Hope this will help you.
mark it as best answer if it helps you.
Thanks       
satakshisatakshi
i have tried using rerender . but which id should be there
Rowallim TechnologyRowallim Technology
I have used id in <apex:pageBlock id="id" > and called it in rerender. This is the id of pageblock.
satakshisatakshi
its not working here
Rowallim TechnologyRowallim Technology
Hi Satakshi
I have checked in my organisation it's working fine.