Values referred in Visualforce

Values referred in Visualforce Fields and Class variables are referred in Visualforce in the form of expressions as below. {!ObjectName.FieldName} {!ClassVariable} <apex:page > <!– {!ObjectName.fieldName} / {!classVariable} –> My Last Name: {!$User.FirstName} &nbsp; {!$User.LastName} My Org Name : {!$Organization.Name} <br/> Profile Name: {!$Profile.Name} <br/> <!– Functions –> {!ISNULL(‘Ranjith’)} <br/> {!IF(2 > 3, true, false)} <br/> {!IF(2 > 3, “not false”, “not true”)} </apex:page>  

Read More

apex:input output components demo

apex:input output components demo <apex:page showHeader=”true” sidebar=”false” tabStyle=”Account”> <apex:form > <apex:sectionHeader title=”My Page” description=”” subtitle=”Student” help=”/apex/FirstPage”> <!– {!flag} –> </apex:sectionHeader> Name: <apex:inputText /> <br/> About me: <apex:inputTextarea /> <br/> password: <apex:inputSecret /> <br/> Description: <apex:inputTextarea cols=”10″ rows=”3″/> <br/> City : <apex:inputText maxlength=”5″/> </apex:form> </apex:page>

Read More

Example on Components – Input Output pageBlockSection

<apex:page showHeader=”true” sidebar=”false” tabStyle=”Account”> <apex:form > <apex:sectionHeader title=”My Page” description=”” subtitle=”Student” help=”/apex/FirstPage”> <!– {!flag} –> </apex:sectionHeader> <apex:pageBlock title=”My Block without Content”></apex:pageBlock> <apex:pageBlock title=”Block to demo INput Output Comp” helpTitle=”Block Help” helpUrl=”/apex/DemoPage”> <apex:pageBlockSection columns=”1″ title=”one column” collapsible=”false”> <apex:outputLabel >My Name</apex:outputLabel> <apex:inputText /> <apex:outputLabel >About Me</apex:outputLabel> <apex:inputTextarea /> <apex:outputLabel value=”Password”></apex:outputLabel> <apex:inputSecret /> <apex:outputLabel value=”Description”></apex:outputLabel> <apex:inputTextarea cols=”10″ rows=”3″/> <br/> <apex:outputLabel value=”City”></apex:outputLabel> <apex:inputText maxlength=”5″/> </apex:pageBlockSection> <apex:pageBlockSection columns=”4″ title=”four columns”> <apex:outputLabel >My Name</apex:outputLabel> <apex:inputText /> <apex:outputLabel >About Me</apex:outputLabel> <apex:inputTextarea /> <apex:outputLabel value=”Password”></apex:outputLabel> <apex:inputSecret /> <apex:outputLabel value=”Description”></apex:outputLabel> <apex:inputTextarea cols=”10″ rows=”3″/> <br/> <apex:outputLabel value=”City”></apex:outputLabel> <apex:inputText maxlength=”5″/> </apex:pageBlockSection>…

Read More

Example on pageBlockSectionItem

<apex:page showHeader=”true” sidebar=”false” tabStyle=”Account”> <apex:form > <apex:sectionHeader title=”My Page” description=”” subtitle=”Student” help=”/apex/FirstPage”> <!– {!flag} –> </apex:sectionHeader> <apex:pageBlock title=”Demo to pageblockSection Item” helpTitle=”Block Help” helpUrl=”/apex/DemoPage”> <apex:pageBlockSection title=”my section” columns=”1″> <apex:pageBlockSectionItem > <apex:outputLabel >My Name</apex:outputLabel> <apex:inputText /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel >About Me</apex:outputLabel> <apex:inputTextarea /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value=”Password”></apex:outputLabel> <apex:inputSecret /> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

Read More

CSS Inline, External and Static Resource

<apex:page showHeader=”true” sidebar=”false” tabStyle=”Account”> <apex:form > <style> .InlineCssCls { color: brown; } h1{ color: yellow; } </style> <apex:stylesheet value=”{!$Resource.ExtCSSFile}”/> <h1> My html content </h1> <apex:sectionHeader title=”My Page” description=”” subtitle=”Student” help=”/apex/FirstPage”> <!– {!flag} –> </apex:sectionHeader> <apex:pageBlock title=”Demo to pageblockSection Item” helpTitle=”Block Help” helpUrl=”/apex/DemoPage”> <apex:pageBlockSection title=”my section” columns=”1″> <apex:pageBlockSectionItem > <apex:outputLabel styleClass=”myCss”>My Name</apex:outputLabel> <apex:inputText /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel style=”color: blue;”>About Me</apex:outputLabel> <apex:inputTextarea /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value=”Password” styleClass=”InlineCssCls”></apex:outputLabel> <apex:inputSecret /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value=”Yes/No” styleClass=”myCSS”></apex:outputLabel> <apex:inputCheckbox /> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

Read More

Difference between InputText and InputField of Visualforce Page

Difference between InputText and InputField of Visualforce Page <apex:page standardController=”Account”> <apex:form > <apex:pageBlock title=”Without pageblock section”> <apex:inputText value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Industry}”/> <apex:inputField value=”{!Account.Industry}”/> </apex:pageBlock> <apex:pageBlock title=”With pageblock section”> <apex:pageBlockSection > <apex:inputText value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Industry}”/> <apex:inputField value=”{!Account.Industry}”/> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock title=”With pageblocksectionItem”> <apex:pageBlockSection > <apex:inputText value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Name}”/> <apex:inputField value=”{!Account.Industry}”/> <apex:inputField value=”{!Account.Industry}”/> <apex:pageBlockSectionItem > <apex:outputLabel value=”Company Revenue”></apex:outputLabel> <apex:inputField value=”{!Account.AnnualRevenue}”/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

Read More