readOnly attribute in apex:page tag
To enable read-only mode for an entire page, set the readOnly attribute on the <apex:page> component to true. For example, here is a simple page that will be processed in ....
To enable read-only mode for an entire page, set the readOnly attribute on the <apex:page> component to true. For example, here is a simple page that will be processed in ....
Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false"> <apex:pagemessages /> <apex:dynamicComponent componentValue="{!lbl}"/></apex:page> Apex Code: public class Sample { public Component.Apex.OutputLabel getlbl() { Component.Apex.OutputLabel lb = new Component.Apex.OutputLabel(); lb.Value = 'Sample'; return ....
disabled attribute in apex:commandButton can be usedto disable button in Salesforce Visualforce Page. Visualforce Page: <apex:page controller="Sample" sidebar="false"> <apex:pagemessages /> <apex:form > <apex:commandButton value="Disable" disabled="{!disabl}" action="{!dis}"/> </apex:form> </apex:page> Apex Controller: ....
Check the below options to fix the "System.LimitException: Too many DML statements: 1" exception in Salesforce. 1.Visualforce Page: In <apex:page> tag, if attribute "readonly" is true and if we try ....
Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false"><apex:form > <apex:pageBlock id="filter" title="Filter"> <apex:pageBlockSection > <apex:pageblockSectionItem > <apex:outputLabel value="Name"/> </apex:pageblockSectionItem> <apex:pageblockSectionItem > <apex:inputText value="{!nam}" /> </apex:pageblockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection columns="5" > ....
Sample Code: Integer counter = [ Select count() FROM Member__c Where Age__c > 40];System.debug('Total Number of records: ' + counter);
Sample code: <apex:page> <apex:tabPanel> <apex:tab label="Pagination"> <apex:include pageName="Pagination"/> </apex:tab> </apex:tabPanel></apex:page> here Pagination is the name of the page already developed. Output: Cheers!!!
Sample Code: Visualforce page: <apex:page controller="Sample" > <apex:form > <apex:pageBlock id="details"> <apex:pageblockTable value="{!memb}" var="m"> <apex:column value="{!m.Name}"/> <apex:column value="{!m.Age__c}"/> </apex:pageblockTable> <apex:pageblockButtons > <apex:commandButton value="<<" rerender="details" action="{!beginning}" disabled="{!prev}"/> <apex:commandButton value="<" rerender="details" action="{!previous}" ....
Sample Code: Visualforce Page: <apex:page controller="Sample" ><!-- Javascript --> <script type="text/javascript"> function validate() { if(document.getElementById('{!$Component.frm.pb.pbs.pbsi1.nam}').value == '') { alert("Account name is mandatory"); } if(document.getElementById('{!$Component.frm.pb.pbs.pbsi2.extid}').value == '') { alert("External id is ....
Sample code: Visualforce page: <apex:page controller="Sample"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:pageBlockSectionItem > <apex:outputLabel value="Value 1"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:inputText value="{!val1}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Value 2"/> </apex:pageBlockSectionItem> ....