Posts

Showing posts from March, 2011

What are Custom Controllers , Custom List Controller and Controller Extensions?

A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user. Example <apex:page controller="myController" tabStyle="Account">     <apex:form>         <apex:pageBlock title="Congratulations {!$User.FirstName}">             You belong to Account Name: <apex:inputField value="{!account.name}"/>             <apex:commandButton action="{!save}" value="save"/>         </apex:pageBlock>     </apex:form> </apex:page> public class MyController {     private final Account account;     public MyController() {         account = [SELECT Id, Name, Site FROM Acco...

Floating Menu on Visualforce Page

Image
Here's an example to create a floating menu. <apex:page > <html> <body> <style> div.floating-menu {position:fixed;background:#fff4c8;border:1px solid #ffcc00;width:150px;z-index:100;} div.floating-menu a, div.floating-menu h3 {display:block;margin:0 0.5em;} </style> <div class="floating-menu"> <h3>Floating Menu</h3> <a href="http://www.quackit.com/css/">CSS</a> <a href="http://www.quackit.com/html/">HTML</a> <a href="http://www.quackit.com/javascript/">JavaScript</a> <a href="http://www.quackit.com/coldfusion/">ColdFusion</a> <a href="http://www.quackit.com/myspace/codes/">MySpace Codes</a> </div> </body> </html> </apex:page>