Displaying custom controller data in visualforce page after onchange event
<blockquote>
<p>I have a picklist containing names of records of an object, &quot;Test_Script&quot;.When I select any option from a picklist(&quot;selectlist&quot; &amp; selectoption are used for implementing picklist),at onchange event the other fields related to that record name should be displayed on visualforce page.</p>
<p>VF Page:</p>
</blockquote>
<pre><code>&lt;h1&gt;Choose Script:&lt;/h1&gt;
&lt;apex:selectlist value=&quot;{!selectedValue}&quot; size=&quot;1&quot;onchange=&quot;{!setValues}&quot;&gt;
                            &lt;apex:selectOptions value=&quot;{!scriptoptions}&quot; /&gt;
                        &lt;/apex:selectlist&gt;
                        &lt;br/&gt;
                        Executioner Name: 
                        &lt;outputfield value=&quot;{!valueResult.executioner_name}&quot;/&gt;
                        &lt;br/&gt;Planner Name: 
                        &lt;outputfield value=&quot;{!valueResult.planner_name}&quot;/&gt;
                        &lt;br/&gt;Reviewer Name: 
                        &lt;outputfield  value=&quot;{!valueResult.reviewer_name}&quot;/&gt;
</code></pre>
<p>Controller:</p>
<pre><code>public class ScriptAttributesController 
{

    public String setValues { get; set; }
    public List&lt;Test_script__c&gt; scriptListWithValues = [select name, id, Executioner__c, Planner__c, Reviewer__c from Test_Script__c];
    public static Test_Script__c valueResult=new Test_Script__c();
    public String selectedValue {get;set;}
    
    public void ScriptAttributesController()
    {
    }

    public List&lt;SelectOption&gt; getScriptoptions()
    {
        List&lt;SelectOption&gt; options = new List&lt;SelectOption&gt;();
        options.add(new SelectOption('select a value','select a value'));
        for(Test_Script__c s: scriptListWithValues )
        {
            options.add(new SelectOption(s.id,s.name));
        }
        return options;
    }
    
        public void setValues()
    {
        valueResult=[select name, id, Executioner__c, Planner__c, Reviewer__c, Iteration__c from Test_Script__c where name='selectedValue' limit 1];
    }
}
</code></pre>
<blockquote>
<p>I am not able to see value on screen on change og picklist value</p>
</blockquote>