1

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}"
            rerender="op1">
            <apex:param assignTo="{!acclookup}" value="{!object__c.AccountId}" />
        </apex:actionSupport>

    </apex:inputField>   
<apex:OutputPanel Id="op1">
                 Picklist
                    <apex:selectList value="{!pick}" multiselect="false"
        size="1">
        <apex:selectOptions value="{!options}" />
        <apex:actionsupport event="onchange">
            <apex:param assignTo="{!object__c.Picklist__C}" value="{!pick}" />
        </apex:actionsupport>
    </apex:selectList>
3
  • 1
    Why do you think you need <apex:actionSupport> here? Just remove it.
    – Adrian Larson
    Commented Feb 7, 2017 at 21:29
  • if I remove <apex:actionSupport> it won't assign value
    – Learner
    Commented Feb 7, 2017 at 21:39
  • It should...that's what the value attribute on your <apex:selectList> tag is for.
    – Adrian Larson
    Commented Feb 7, 2017 at 21:40

1 Answer 1

2

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.

You must log in to answer this question.

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