Salesforce Visualforce Page

Salesforce

How to create donut chart in Visualforce page using Apex in Salesforce?

Sample code: Visualforce page: <apex:page controller="Graph" >    <apex:pageblock title="Members and their Years of experience" >        <apex:chart height="250" width="350" data="{!pieData}">             <apex:pieSeries tips="true" dataField="data" labelField="name" donut="50"/>             <apex:legend position="bottom"/>        </apex:chart>    </apex:pageblock>            ....

Salesforce

How to fetch child records from parent in SOQL in controller in Salesforce?

Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false"><apex:form >    <apex:pageBlock >        <apex:pageblockTable value="{!memb}" var="m">            <apex:column value="{!m.Name}"/>        </apex:pageblockTable>        <apex:pageblockTable value="{!interst}" var="i">            <apex:column value="{!i.Name}"/>        </apex:pageblockTable>            </apex:pageBlock></apex:form>    </apex:page> Apex Controller: public class Sample{    ....

Salesforce

How to make a tab default in apex:tabPanel while opening the page?

Sample Code: Visualforce page:  <apex:page controller="Sample" sidebar="false"><apex:form >    <apex:tabPanel id="theTabPanel" selectedTab="Two" value="{!tabOpt}">        <apex:tab label="One" name="One" id="One"><apex:commandButton value="Go to Two" action="{!switch}"/></apex:tab>        <apex:tab label="Two" name="Two" id="Two">content for tab two</apex:tab>    </apex:tabPanel></apex:form>    </apex:page> Apex ....

Salesforce

How to invoke multiple methods in a controller from a command button in Salesforce?

Sample Code:Visualforce page:<apex:page controller="Sample"><apex:form >    <apex:pageblock id="pg1" title="Block1">        <apex:outputText value="{!one}"/>    </apex:pageblock>        <apex:pageblock id="pg2" title="Block2">        <apex:outputText value="{!two}"/>        </apex:pageblock>        <apex:pageblock id="pg3" title="Block3">        <apex:outputText value="{!three}"/>        </apex:pageblock>        <apex:pageblock id="pg4" ....

Salesforce

How to switch from one tab to another when button is clicked in apex:tabPanel?

Sample Code:Visualforce page:<apex:page controller="Sample"><apex:form >    <apex:tabPanel id="theTabPanel" value="{!tabOpt}">        <apex:tab label="One" name="One" id="One"><apex:commandButton value="Go to Two" action="{!switch}"/></apex:tab>        <apex:tab label="Two" name="Two" id="Two">content for tab two</apex:tab>    </apex:tabPanel></apex:form>    </apex:page>Apex Controller:public class Sample{    public String ....

Salesforce

How to disable textbox in Visualforce page based on picklist values?

Sample code:Visualforce page:<apex:page controller="Sample"><apex:form ><apex:actionFunction name="changeBoolCall" action="{!changeBool}"/>    <apex:pageblock id="pg">        <apex:pageblockSection >            <apex:pageblockSectionItem >                Select currency :            </apex:pageblockSectionItem>            <apex:pageblockSectionItem >               <apex:selectList value="{!curency}" size="1" multiselect="false">                   <apex:selectOption itemLabel="--- None ---" itemValue="none"/>                   <apex:selectOption itemLabel="Indian ....

Salesforce

How to fetch data from Controller and display it in Visualforce page?

Sample code: Visualforce page: <apex:page sidebar="false" controller="Sample"> <apex:form > <apex:pageblock id="account" title="Account Details(Standard Object)" > <apex:pageblockTable value="{!acc}" var="a"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.AccountNumber}"/> </apex:pageblockTable> <apex:pageblockButtons > <apex:commandButton value="Fetch Account" action="{!fetchAccount}" reRender="account"/> ....