Skip to content

Instantly share code, notes, and snippets.

@101dvlp
Created July 31, 2017 11:10
Show Gist options
  • Save 101dvlp/5300ab2df3f8611ea6bdde3d87ec7b46 to your computer and use it in GitHub Desktop.
Save 101dvlp/5300ab2df3f8611ea6bdde3d87ec7b46 to your computer and use it in GitHub Desktop.
public with sharing class ContactSampleExtension {
private final Contact cont;
public String selected {get; set;}
public ContactSampleExtension(ApexPages.StandardController stdController) {
this.cont = (Contact)stdController.getRecord();
}
public List<SelectOption> getItems(){
List<SelectOption> items = new List<SelectOption>();
items.add(new SelectOption('1', 'select1'));
items.add(new SelectOption('2', 'select2'));
items.add(new SelectOption('3', 'select3'));
items.add(new SelectOption('4', 'select4'));
items.add(new SelectOption('5', 'select5'));
return items;
}
public void doButtonAction(){
System.debug('選択肢の値を表示 >> ' + selected);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment