+ Start a Discussion

Passing Parameters from Page to Controller


I want to pass checbox value true to the controller from visualforce page..

this one part of my Vf page:

<apex:pageBlockSection >
                          <apex:outputtext >Want Home Delivery</apex:outputtext>
                         <apex:inputCheckbox value="{!shop.Want_Home_Delivery__c}" onclick="{!homedelivery}" >
                         <apex:param name="myParam" value="my Value"/>
                          <apex:outputPanel rendered="{!isSelected}">
                           <c:HomeDelivery ></c:HomeDelivery>


and Controller for this Content of the page:

public void homedelivery{ get{
    string myParam = apexpages.currentpage().getparameters().get('myParam');

isSelected =true;



I have to display some Description about that field after checking...so if that field is checked controller perform some action.can anyone help me in this??

Chamil MadusankaChamil Madusanka



get help from these links







If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.


Chamil's Blog



Platy ITPlaty IT

The "onclick" attribute you're using is to execute javascript not a controller method.  Use an actionSupport tag with the action attribrute to call homedelivery instead, just place the actionSupport inside of the checkbox where you have the param and set the event attribute = "onclick".  You'll also need a rerender tag to refresh and see the change.