-
Sample code for option button on VF page and getting value in apex class
Hi
I need to built a page with say two or more fields - their values will be Yes or No - based on if it is selected or not.
Get these field values in class and based on field values set variable values and call the function e.g:
VF Page:
Text1: Yes(it is a radio button)
Text2: Yes(radio)
call saveList from action button on VF page.
Apex Class:
Public String Cat
Public String Req
public PageReference saveList()
{if(Text1 == Yes):
Cat = 'abc'
Req = 'abc'
CallFunction(Cat,Req)
}
if(Text2 == 'Yes'){
Cat = 'def'
Req = 'def'
CallFunction(Cat,Req)
}
}
public void CallFuntion(String Cat, String Req)
{
statements;
}
Log In to reply.
Popular Salesforce Blogs
Who Ya Gonna Call – ‘No Longer Your IT Team’ - (How To Enhance Your Value As A Salesforce Admin!)
Telephony has forever and a day been a dark art , thrust into the hands of the IT Department who typically do not have the…
The Salesforce Customization Dilemma: Get In or Stay Out?
You have your Salesforce solution set up and running and it seems all you’ve got to do right now is relax and enjoy the moment.…
Salesforce Visualforce Vs Salesforce Lightning Component
Visualforce On the server-side a strong set of tags solved in Visualforce. The visualforce framework is called a center page internet application type. Since the…
Popular Salesforce Videos
Salesforce TrailheaDX '18 Opening Keynote - Part 1: Create Connected Customer Experiences
TrailheaDX ’18 Opening Keynote – Part 2: Salesforce Platform TrailheaDX ’18 Opening Keynote – Part 3: Connect Every Experience Salesforce TrailheaDX ’18 Opening Keynote –…
Dreamforce To You 2020 - Algoworks
The wait is over – Dreamforce will be going ahead in 2020! Salesforce has gone back to the drawing board and rebuilt Dreamforce 2020 for…