You need to sign in to do that
Don't have an account?

Passing Parameters from Page to Controller
Hi,
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:inputCheckbox>
<apex:outputPanel rendered="{!isSelected}">
<c:HomeDelivery ></c:HomeDelivery>
</apex:outputPanel>
</apex:pageBlockSection>
and Controller for this Content of the page:
public void homedelivery{ get{
string myParam = apexpages.currentpage().getparameters().get('myParam');
if(myParam=='true')
{
isSelected =true;
}
}
set;
}
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??
Hi,
get help from these links
http://salesforceworld.blogspot.com/2011/06/parameter-passing-using.html
http://boards.developerforce.com/t5/Visualforce-Development/actionfunction-passing-multiple-variables-to-JS-function/m-p/285801#M36280
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
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.