Created
August 14, 2015 05:55
-
-
Save victorabraham/88ebe8ca684b066a366a to your computer and use it in GitHub Desktop.
Controller for autocomplete page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AutoCompleteController { | |
| //String property to pass JSON data to page | |
| public String toEmailJSON{get;set;} | |
| //String property to save the values selected by user | |
| public String selectedEmails{get;set;} | |
| //Constructor of the class where email addresses are obtained from custom setting and converted to JSON | |
| public autocompleteController(){ | |
| Set<String> autocompleteEmailSet = AutocompleteEmails__c.getAll().keyset(); | |
| toEmailJSON = JSON.serialize(autocompleteEmailSet); | |
| } | |
| //Method to demonstrate that values are coming to controller on button click | |
| public PageReference receiveValues() { | |
| //Debugging the value passed from page | |
| System.debug(selectedEmails); | |
| return null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment