The Selectlist is working fine, the value of the the selection pass properly to the controller, but the param value will not pass to the controller.


<apex:page controller="MS4_class" sidebar="false">
    <apex:form >        
        <apex:selectList id="SelectedVW" value="{!SelectedVW}" size="1" multiselect="false" style="width:150px">
            <apex:selectOptions value="{!ListOfVW}" />                
            <apex:actionSupport event="onchange" action="{!getMSListPR}">
                <apex:param name="SearchEngine" value="cat" assignTo="{!SearchEngine}" />
  • You don't need to write actionSupport to pass selected value to controller. Refer this example Jun 23 '17 at 6:15
  • Please share your controller code too. Jun 23 '17 at 6:15
  • @RohitMourya I need both variables in controller, so I though I need the param. Can I pass otherwise two variables to the controller if I select an option?
    – peXeq
    Jun 23 '17 at 6:39
  • If you want values on change of any event then only use actionsupport or actionFunction otherwise on button click these values will be automatically available in controller since you must have defined them using {get;set;}. Jun 23 '17 at 6:43
  • @RohitMourya If you can see, I have an on change event and I use the actionsupport, but I can just pass one value to the controller. Or it is possible to pass more variables with the actionsuppert?
    – peXeq
    Jun 23 '17 at 6:54

To pass param value in controller we must use rerender attribute. Use rerender attribute with your apex:actionSupport. It will solve your issue.

<apex:actionSupport event="onchange" action="{!getMSListPR}" rerender="none">
      <apex:param name="SearchEngine" value="cat" assignTo="{!SearchEngine}" />
  • Which object is to rerender?
    – peXeq
    Jun 23 '17 at 6:37
  • @peXeq check my update answer. You can rerender complete form or just use none. Jun 23 '17 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.