Posts

Showing posts from April, 2016

Generic Component for Loading Icon on Visualforce Pages

Image
While developing a Solution using Visualforce page and Apex, we have one common requirement which is to  show loading icon  whenever user click on button/link/panel etc. Few use case to show loading icon could be:       1.    Notify user that action he asked for is in progress. 2.    Don't want user to make any change till previous action finishes. The following is the screenshot of how Loading icon would show: To achieve this, we will create a new VF Component ( Go to Setup -> Develop -> Component -> New. Name= “LoadingIcon” ) The Icon that we will be using here is standard Icon provided by salesforce, therefore no need to upload any static resource. Visualforce Component: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 <apex:component > <apex:actionStatus onstart=

Use of isdtp parameter in URL in Salesforce (Hide header and Sidebar)

Hi Guys, If we want to hide header for VF what do you do, very simple, you just specify the showheader="false". Similarly if want to hide Sidebar and chat widget from VF, we specify sidebar=”false” and showChat=”false” respectively. These are simple attributes we use in Page tab to hide header, sidebar and chat widget. Ex: <apex:page showHeader=”false” sidebar=”false” showChat=”false”> But suppose you want to display a report on your VF, and you don't want the header and sidebar to appear, Or what if in case you want to display Iframe and don’t want header,sidebar in that Page. isdtp comes in picture, so we can say that main purpose of isdtp can be used to hide SFDC header and sidebar on Standard Pages This will work after added the parameter in standard salesforce pages by using the url parameter:  isdtp=mn  or  lt or vw or nv vw  – The VF page will be rendered without header and sidebar, supports aloha theme, allows chatter lt  

Javascript Function for Validation on Input fields ( Useful for Number,Letters,Characters,Currency validations)

Hi Guys, Many a times we have requirement where we need to have validation on Input field to let user enter  just number, just letters or related to currency etc. Below you can find a single javascript function to handle all situation related to numbers, characters, currency, specialCharacters. Javascript code:    <script type="text/javascript">     // This function is being used for providing different validation on your text box as per your need     function inputLimiter(e,allow) {             var AllowableCharacters = '';             if (allow == 'Letters'){AllowableCharacters=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';}             if (allow == 'Numbers'){AllowableCharacters='1234567890';}             if (allow == 'NameCharacters'){AllowableCharacters=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-.\'';}             if (allow == 'NameCharactersAndNumbers'){Allowa