Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar

Taiki Yoshikawa tyoshikawa1106

View GitHub Profile
@tyoshikawa1106
tyoshikawa1106 / CancelButtonController.cls
Last active December 16, 2015 14:19
CancelButton Component
public with sharing class CancelButtonController {
public String prmCancelButtonLabel {get; set;}
public PageReference prmReturnUrl {get; set;}
private static final PageReference DEFAULT_URL = new PageReference('/home/home.jsp');
/*
* コンストラクタ
* @param : なし
<apex:page >
<apex:canvasApp developerName="Webinar_Java_Demo"/>
</apex:page>
@tyoshikawa1106
tyoshikawa1106 / EnhancedListDemoPage.page
Last active December 16, 2015 18:09
apex:enhancedList
<apex:page>
<apex:enhancedList type="Account" height="300" rowsPerPage="10" id="AccountList" />
</apex:page>
public with sharing class CheckingTheBoxesController {
public Map<Id, Boolean> selected {get; set;}
public List<Opportunity> opportunities {get; set;}
public Boolean forAll {get; set;}
public CheckingTheBoxesController() {
this.selected = new Map<Id, Boolean>();
this.opportunities = new List<Opportunity>();
@tyoshikawa1106
tyoshikawa1106 / Before.cls
Last active December 16, 2015 19:58
? 判定文 Before
private Account getAccount() {
List<Account> accounts = [
select
Id
,Name
from
Account
limit 1
];
@tyoshikawa1106
tyoshikawa1106 / After.cls
Created April 30, 2013 13:17
? 判定文 After
private Account getAccount() {
List<Account> accounts = [
select
Id
,Name
from
Account
limit 1
];
@tyoshikawa1106
tyoshikawa1106 / SearchController.cls
Created May 3, 2013 14:13
2つのページと同一コントローラーサンプル
public with sharing class SearchController {
public List<Account> accounts {get; set;}
public SearchController() {
this.accounts = new List<Account>();
}
public void doSearch() {
this.accounts = [select Id,Name from Account limit 200];
@tyoshikawa1106
tyoshikawa1106 / CsvListDownloadPage.page
Last active December 16, 2015 23:09
Visualforce CSV Download
<apex:page controller="CsvListSearchController" cache="true" contentType="text/csv#filename.csv" language="en-US">
"Name","AccountNumber","Site","NumberOfEmployees"
<apex:repeat value="{!accounts}" var="item">
"{!item.Name}","{!item.AccountNumber}","{!item.Site}","{!item.NumberOfEmployees}"
</apex:repeat>
</apex:page>
@tyoshikawa1106
tyoshikawa1106 / ErrorPopupController.cls
Last active December 17, 2015 00:11
エラー処理の後にポップアップメッセージ
public with sharing class ErrorPopupController {
public Contact contact {get; set;}
public String errorMsg {get; set;}
public ErrorPopupController() {
this.contact = new Contact();
this.errorMsg = 'bat';
}
/* Better styles for embedding GitHub Gists */
.gist{font-size:13px;line-height:18px;margin-bottom:20px;width:100%}
.gist pre{font-family:Menlo,Monaco,'Bitstream Vera Sans Mono','Courier New',monospace !important}
.gist-meta{font-family:Helvetica,Arial,sans-serif;font-size:13px !important}
.gist-meta a{color:#26a !important;text-decoration:none}
.gist-meta a:hover{color:#0e4071 !important}