+ Start a Discussion
Ashok Kumar NayakAshok Kumar Nayak 

ActionSupport event="OnChange" is not working for my inputFieldType

I need to display a panel if the inputField Value get selected. 
And My InputField is of picklist type. 

But the onchange event doesn't fire when the picklist values are changing that's why my rendered condition is failing as well.

Plz share if you found any solution or workarround for this.
Below is code snippet.

<apex:pageblock>
<apex:pageBlockSection>
<apex:pageblockSectionItem >
                    Type : <apex:inputField id="type" style="width:200px;" required="true" value="{!cse.Case_Type__c}">
                    <apex:actionSupport event="onchange" reRender="blockToRerender"/>
                    </apex:inputField>
</apex:pageBlockSection>

<apex:outputPanel id="blockToRerender">
<apex:pageBlockSection id="pbs2" rendered="{!cse.Case_Type__c=='Some Value'}">
<apex:pageblockSectionItem id="psi1">
                    Description : <apex:inputField id="des" value="{!cse.Description}"/>
                </apex:pageblockSectionItem>
                <apex:pageblockSectionItem >
                Answer Provided :<apex:inputField id="ans" value="{!cse.Answer_Provided__c}"/>
                </apex:pageblockSectionItem>
                </apex:pageBlockSection>
  </apex:outputPanel>
</apex:pageblock>
VineetKumarVineetKumar
Try printing the value of {!cse.Case_Type__c} inside the outputPanel and see if there is any change happening
Ashok Kumar NayakAshok Kumar Nayak
Hi Vineet,
It's coming null if I print it. And still null after I change the value also.
That Input Field is a dependent picklist type.
I tried in this way as well :-

JS Code:--
<script>
      function Callmefunc(id)
   {
   alert(''+id); 
   var type = document.getElementById(id).value;
   alert(type);
    check(type); 

   } 
      </script>

Now VF Page Code:-
<apex:actionFunction name="check" action="{!ShowPanel}" reRender="blockToRerender" >
<apex:param name="TypeSelected" value="" />
</apex:actionFunction>
                    Type : <apex:inputField id="check" style="width:200px;" required="true" value="{!cse.Case_Type__c}" onchange="Callmefunc('{!$Component.check}');"/>
<apex:outputPanel id="blockToRerender" rendered="{!display==true}"></apex:outputPanel>

Then in Controller:
public static boolean display{get; set;}
display=false;
public void ShowPanel(){
 act=System.currentPageReference().getParameters().get('TypeSelected');
 if(act=='Request for Information'){
 display=true;}

Now If I try to print the value of "display" it's printing false also.

Please suggest if you can find any solution for this. Thanks is Advance.