Professional Documents
Culture Documents
tabpanel - switchtype
What is it ?
tabpanel tag facilitates tabbed view of the content. The content could be any container tag like div,
span, iframe, etc. The 'Switchtype' attribute specifies how the content should be rendered.
<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>
Visualforce - Beyond Basics Series 2 - Use $Action & avoid URL Hacks
What is URL Hacks ?
The technique of reverse engineering standard salesforce URL & using them to build a custom solution.
How to avoid it ?
Salesforce provides standard ways to access the URL & parameters in Visualforce & Apex. Developers
must use them instead of hardcoding the URL's in the code.
For illustration, i have shown how to get the URL's for create, view, edit delete for an opportunity record
<apex:page standardController="Opportunity">
What would you like to do with this Opportunity - {!Opportunity.Name}
<apex:panelGrid columns="1">
</apex:page>
Visualforce - Beyond Basics Series 3 - Pass params to action methods
What is action methods ?
After the page load, we can send requests to server asynchronously to perform some actions which is
called action methods. This is achieved by sending POST request along with necessary parameters in
headers.
apex:commandButton
apex:commandLink
apex:actionSupport
apex:actionFunction
<apex:panelGrid columns="2">
</apex:panelGrid>
</apex:form>
</apex:page>
class
public class testcls3_06122016 {
}
Visualforce - Beyond Basics Series 4 - actionpoller is your timer
How to perform timed action ?
if you need to fire action method calls (ajax calls to server) periodically, just like a timer, you need to use
actionPoller tag. This will call the action methods at regular intervels & rerender the section of the
screen(optionally).