0

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.

PAGE

<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}" />
            </apex:actionSupport>
        </apex:selectList> 
   </apex:form>
</apex:page>
6
  • You don't need to write actionSupport to pass selected value to controller. Refer this example Commented Jun 23, 2017 at 6:15
  • Please share your controller code too. Commented Jun 23, 2017 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
    Commented Jun 23, 2017 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;}. Commented Jun 23, 2017 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
    Commented Jun 23, 2017 at 6:54

1 Answer 1

1

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}" />
</apex:actionSupport>
2
  • Which object is to rerender?
    – peXeq
    Commented Jun 23, 2017 at 6:37
  • @peXeq check my update answer. You can rerender complete form or just use none. Commented Jun 23, 2017 at 7:04

You must log in to answer this question.

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