[SalesForce] How to stop refreshing the VF page

I created a Vf page to show Account lookup and Picklist option. When An account is choosen the Picklist will render the values.

Once I select the picklist value it is refreshing the entire VF page
How to stop this can anyone please help me ?

Page :

    <apex:inputField value="{!object__c.AccountId}">
        <apex:actionSupport event="onchange" action="{!method1}"
            <apex:param assignTo="{!acclookup}" value="{!object__c.AccountId}" />

<apex:OutputPanel Id="op1">
                    <apex:selectList value="{!pick}" multiselect="false"
        <apex:selectOptions value="{!options}" />
        <apex:actionsupport event="onchange">
            <apex:param assignTo="{!object__c.Picklist__C}" value="{!pick}" />

Best Answer

You need to add rerender to appropriate component in your second actionSupport inside selectList to avoid refresh of whole page, if it is required.

Rerender: The ID of one or more components that are redrawn when the result of an AJAX update request returns to the client. This value can be a single ID, a comma-separated list of IDs, or a merge field expression for a list or collection of IDs. Without it whole page would refresh.

Related Topic