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>

Related posts

Leave a Comment