0

Well I am facing a strange issue... I have a vfpage with multiple field dependency. The dependent picklists were rendered appropriately till yesterday but today I find the rerender function is not working for dependent picklist

Here is my code:

VFpage

<apex:page standardController="Contact" extensions="onboardform">
    <apex:form id="form">
        <apex:outputPanel id="EntryForm">
            <div>
                <tr>
                    <td><b>Segment:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <apex:selectList size="1" value="{!con.Segment__c}" id="a" style="width:230px">
                            <apex:selectOptions value="{!segmentSelectList}" />
                            <apex:actionSupport event="onclick" reRender="b,c,d" />
                        </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td><b>System:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <apex:selectList size="1" value="{!con.System__c}" id="b" style="width:230px">
                            <apex:selectOptions value="{!systemSelectList}" />
                            <apex:actionSupport event="onclick" reRender="c,d" />
                        </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td><b>Role:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <apex:selectList size="1" value="{!con.Role__c}" id="c" style="width:230px">
                            <apex:selectOptions value="{!roleSelectList}" />
                            <apex:actionSupport event="onclick" reRender="d" />
                        </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td><b>Project/App:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <apex:selectList size="1" value="{!con.Project__c}" id="d" style="width:230px">
                            <apex:selectOptions value="{!projectSelectList}" />
                            <apex:actionSupport event="onclick" reRender="e" />
                        </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td><b>Required Approver:</b> &nbsp;&nbsp;
                        <apex:selectList size="1" value="{!con.Approver_Requestor__c}" id="e" style="width:230px">
                            <apex:selectOptions value="{!approverSelectList}" />
                            <apex:actionSupport event="onclick" reRender="a" />
                        </apex:selectList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <apex:commandButton value="Submit" action="{!submit}" />
                    </td>
                </tr>
                </table>
            </div>
        </apex:outputPanel>
    </apex:form>
</apex:page>

Controller

public class onboardform {
    public Contact con {get;set;}
    String conId;
    String stdcon;
    public onboardform(ApexPages.StandardController stdcon) {
        conId = ApexPages.CurrentPage().getParameters().get('Id');
        if (conId != null && conId != '') // if id is in url means record is for edit 
            con = (Contact) stdcon.getRecord();
        else // else you r gonna create new record
            con = new Contact();
    }
    public List < SelectOption > getsegmentSelectList() {
            List < SelectOption > segmentSelectList = new List < SelectOption > ();
            segmentSelectList.add(new SelectOption('None', '--- None ---'));
            segmentSelectList.add(new SelectOption('BR', 'Brand'));
            .
            .
            return segmentSelectList;
        }
        ......
    public PageReference submit() {
        if (conId != null && conId != '')
            update con;
        else {
            Contact newContact = new Contact();
            newContact.FirstName = con.FirstName;
            newContact.LastName = con.LastName;
            newContact.HUB_ID__c = con.HUB_ID__c;
            newContact.Disney_Email__c = con.Disney_Email__c;
            newContact.Segment__c = con.Segment__c;
            newContact.System__c = con.System__c;
            newContact.Role__c = con.Role__c;
            newContact.Project__c = con.Project__c;
            newContact.Approver_Requestor__c = con.Approver_Requestor__c;
            insert newContact;
            conId = newContact.Id;
            PageReference requestPage = new pagereference('/' + newContact.id); //Observe the change here .The Id needs to be populated 
            return requestPage;
        }
        return null;
    }
}

Can anyone tell me why the dependent picklist values are not getting refreshed?

1
  • Use onchange instead of onclick.
    – MIX DML
    Jul 11, 2016 at 12:27

1 Answer 1

0

You have to reRender the top of the panel id "EntryForm". It will work.

1
  • I tried using the <apex:actionSupport event="onclick" reRender="EntryForm" /> but no change..
    – MaxPyne
    Jul 11, 2016 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .