Is there a customization section common to all Apps ?
Yes. Salesforce provides sidebar for this purpose. This sidebar is nothing but a collection of standard & custom components. Standard components include Create New, Recent Items, Tags, Custom Links, Recycle Bin.
What is allowed inside a sidebar component ?
you can have one of the following types for a component,- Links
- Image
- HTML
- Visualforce
How can we use visualforce ?
Most of the time one can use visualforce to build a sidebar component for one of 3 purposes,- Output Stats, Quotes, Reminders, Important messages etc
- Input a value from user & take action in Apex
- Set of links for Navigation
Where is the code ?
I have given code for illustrating all these use cases. To try this out,1) you need to create a new 'Custom Component' under Setup -> Home -> Home Page Components.
- with 'visualforce' type, height 200px, narrow type
- select the visualforce page (copy the code from below)
2) Then, you need to add this new component into current Home Page Layout.
This file contains 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
<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/> | |
<!-- User Input Section (Input Area) --> | |
<apex:inputText value="{!searchStr}" html-placeholder="Type something to search in products"/> | |
<apex:commandButton value="Search" action="{!doSearch}" reRender="SearchResultArea"/> | |
<apex:outputPanel id="SearchResultArea"> | |
<apex:outputText value="{!searchResult}"/> | |
</apex:outputPanel> | |
<hr/><br/> | |
<!-- Navigation Section (Redirection Area) --> | |
<apex:outputPanel layout="block"> | |
<apex:outputText value="Menu" style="font-weight:bold;"/> | |
<apex:panelGrid columns="1"> | |
<apex:outputLink value="https://www.google.com" target="_blank"> | |
</apex:outputLink> | |
<apex:outputLink value="https://www.wikipedia.com" target="_blank"> | |
Wikipedia | |
</apex:outputLink> | |
</apex:panelGrid> | |
</apex:outputPanel> | |
</apex:form> | |
</apex:page> |
This file contains 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 testcls5_06122016 { | |
public String searchStr {get; set;} | |
public String searchResult {get; set;} | |
public void doSearch() { | |
searchResult = '10 products found'; | |
} | |
} |
No comments:
Post a Comment
Thanks for reading my blog !