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
ankitha varraankitha varra 

Action support is not working in Visualforce page

<apex:page standardController="Lead" >
  <apex:form >
  <apex:pageblock >
  <apex:pageblockSection >
  <apex:pageblocksectionItem >
   <apex:outputLabel >Lead Name</apex:outputLabel>
   <apex:inputfield value="{!Lead.name}" rendered="{!if(Lead.Status='Closed-Converted',true,false)}" id="Leadname"/>
  </apex:pageblocksectionItem>
  <apex:inputfield value="{!Lead.status}">
  <apex:actionSupport event="Onselect"  reRender="Leadname"/>
  </apex:inputfield>
  </apex:pageblockSection>
   </apex:pageblock>
  </apex:form>
</apex:page>

i am not getting any errors , even though  its not working
ssheikhssheikh
I'm seeing that you haven't call any controller method from action support.

Problem
Let say we have 10 leads whose  "Lead.Status='Closed-Converted". Then you need to write a method in controler which will fire a query to get records of leads in list and then iterate over that list to display the respected leads.

It will help you.Mark correct if my answer solves your concern.

Thanks,
Shoyab
Arunkumar RArunkumar R
Hi Ankitha,

1. Use output panel
2. Status which you mentioned in condition is wrong. You were missed space "Closed-Converted". It should be, "Closed - Converted".
3. Use onchange event instead of onselect. 

Updated code:
<apex:page standardController="Lead" >
    <apex:form >
        <apex:pageblock >
            <apex:pageblockSection >
                <apex:pageblocksectionItem >
                    <apex:outputPanel id="Leadname">
                        <apex:outputLabel >Lead Name</apex:outputLabel>
                        <apex:inputfield value="{!Lead.name}" rendered="{!if(Lead.Status='Closed - Converted',true,false)}" />
                    </apex:outputPanel>
                </apex:pageblocksectionItem>
                <apex:inputfield value="{!Lead.status}">
                    <apex:actionSupport event="onchange" reRender="Leadname"/>
                </apex:inputfield>
            </apex:pageblockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>