Skip to content

Instantly share code, notes, and snippets.

View sankaran1984's full-sized avatar

Sankaran Nepolean sankaran1984

View GitHub Profile
@sankaran1984
sankaran1984 / gist:9429dcc16572471e014726e2c19e874f
Created December 6, 2016 13:03
Visualforce - Beyond Basics - Series
<apex:page >
<apex:sectionHeader title="Client SwitchType"/>
<apex:tabPanel switchType="client" selectedTab="wikipedia">
<apex:tab label="wikipedia" name="wikipedia">
<apex:iframe src="https://www.wikipedia.org"/>
</apex:tab>
<apex:tab label="Bing" name="BingName">
<apex:iframe src="https://www.bing.com"/>
</apex:tab>
</apex:tabPanel>
@sankaran1984
sankaran1984 / gist:20a37d88b828cd0b37947ae1bf295eab
Created December 6, 2016 13:48
Visualforce - Beyond Basics
<apex:page standardController="Opportunity">
What would you like to do with this Opportunity - {!Opportunity.Name}
<apex:panelGrid columns="1">
<!-- create -->
<apex:outputLink value="{!URLFOR($Action.Opportunity.New)}">Create New</apex:outputLink>
<!-- view -->
<apex:outputLink value="{!URLFOR($Action.Opportunity.View, Opportunity.Id)}">View</apex:outputLink>
@sankaran1984
sankaran1984 / gist:4559edc4d7c362787be1b0423b9fad8c
Created December 6, 2016 15:55
Visualforce - Beyond basics
<apex:page controller="testcls3_06122016">
<apex:form>
<apex:actionFunction name="actionFn_Js" reRender="UserMessage">
<apex:param name="actionName" value="Link-ActionFunction" assignTo="{!actionName}"/>
</apex:actionFunction>
<apex:panelGrid columns="2">
<!-- commandbutton -->
@sankaran1984
sankaran1984 / gist:d0ac95527ad914f94b2600b2116f0b56
Created December 6, 2016 15:56
Visualforce - Beyond Basics
public class testcls3_06122016 {
public String actionName{get;set;}
}
@sankaran1984
sankaran1984 / gist:9fefbf450ad55467c17e5c32c49d6f27
Created December 6, 2016 16:36
Visualforce - Beyond Basics
<apex:page controller="testcls4_06122016" >
<apex:form>
<apex:actionPoller interval="5" action="{!timerFired}"
enabled="{!userRetries < 10}" reRender="UserMessage" />
<apex:outputPanel id="UserMessage">
User Retry Count - {!userRetries}
</apex:outputPanel>
</apex:form>
</apex:page>
@sankaran1984
sankaran1984 / gist:59b5e3ffb6549ab623349821bbc69e33
Created December 6, 2016 16:38
Visualforce - Beyond Basics
public class testcls4_06122016 {
public Integer userRetries{get;set;}
public testcls4_06122016() {
userRetries = 0;
}
/* Action Methods */
public void timerFired() {
@sankaran1984
sankaran1984 / gist:cdbe896550b86a80450b290f1664b3bb
Created December 6, 2016 18:29
Visualforce - Beyond Basics
<apex:page controller="testcls5_06122016">
<apex:form>
<!-- Display Section (Output Area) -->
<apex:outputPanel layout="block">
Today's Quote - {!$Setup.TodaysQuote__c.Quote__c}
</apex:outputPanel>
<hr/><br/>
@sankaran1984
sankaran1984 / gist:00ff5dda826df7d73a8c0b0a31202972
Created December 6, 2016 18:29
Visualforce - Beyond Basics
public class testcls5_06122016 {
public String searchStr {get; set;}
public String searchResult {get; set;}
public void doSearch() {
searchResult = '10 products found';
}
}
@sankaran1984
sankaran1984 / gist:69308b49dfb7f98ca71d44b933c5d4b2
Created December 8, 2016 17:20
Visualforce - Beyond Basics
<apex:page >
<style>
.myClass {
border : 2px solid red;
}
</style>
<apex:form>
@sankaran1984
sankaran1984 / gist:16fce2ba45c51cacdc73b6c4afecd0f1
Created December 8, 2016 17:44
visualforce - Beyond Basics
public class testcls7_08122016 {
public string pagemessage { get; set;}
public testcls7_08122016() {
pagemessage = 'page initialized to default value';
}
public void init_page1() {
pagemessage = 'page initialized by page1';