You need to sign in to do that
Don't have an account?
Raj R.
What is the recommended way to setup a Lightning page so that it takes user input and passes it off to an apex class?
Hi,
We have to create a lightning page that has a set of checkboxes that a user is allowed to set to true or false. There is also a button that based on the checkboxes that are selected, it will perform some action through an apex classes. A sample scenario is below. What is the recommended way to accomplish this as i am trying to optimize and keep things simple?
Example scenario (assume 20 checkboxes exists)
We have to create a lightning page that has a set of checkboxes that a user is allowed to set to true or false. There is also a button that based on the checkboxes that are selected, it will perform some action through an apex classes. A sample scenario is below. What is the recommended way to accomplish this as i am trying to optimize and keep things simple?
Example scenario (assume 20 checkboxes exists)
- checkbox1=true
- checkbox2=true
- checkbox3=true
- checkbox10=true
- all other checkboxes are false
- On click of a button, the input should be passed to an apex class which will take the input and run some action based on what is selected as true
//lightning component controller and JS
//Component controller
//Helper jS
//Wrapper class which you will have to modify as per your need. Add all the required data field in this wrapper class
//Main Apex controller which will receive your data from the lghtning page
All Answers
For all this you will have to look at the tarilhead how to create lightning components.
Collect all the values from the page and assign back to APEX controller that is asscoiated with lightning page component.
//lightning component controller and JS
//Component controller
//Helper jS
//Wrapper class which you will have to modify as per your need. Add all the required data field in this wrapper class
//Main Apex controller which will receive your data from the lghtning page