
Force.com Cookbook Sample Code
Chapter 13: Getting Started with Visualforce - Creating a Wizard with Visualforce Pages
To download all the code samples, access the Cookbook. -
Page 2 of the wizard.
<apex:page controller="newOpportunityController" tabStyle="Opportunity">
<apex:sectionHeader title="New Customer Opportunity" subtitle="Step 2 of 3"/>
<apex:form>
<apex:pageBlock title="Opportunity Information">
<apex:facet name="footer">
<apex:outputPanel>
<apex:commandButton action="{!step1}" value="Previous" styleClass="btn"/>
<apex:commandButton action="{!step3}" value="Next" styleClass="btn"/>
</apex:outputPanel>
</apex:facet>
<apex:pageBlockSection title="Opportunity Information">
<apex:panelGrid columns="2">
<apex:outputLabel value="Opportunity Name" for="opportunityName"/>
<apex:inputField id="opportunityName" value="{!opportunity.name}"/>
<apex:outputLabel value="Amount" for="opportunityAmount"/>
<apex:inputField id="opportunityAmount" value="{!opportunity.amount}"/>
<apex:outputLabel value="Close Date" for="opportunityCloseDate"/>
<apex:inputField id="opportunityCloseDate" value="{!opportunity.closeDate}"/>
<apex:outputLabel value="Stage" for="opportunityStageName"/>
<apex:inputField id="opportunityStageName" value="{!opportunity.stageName}"/>
<apex:outputLabel value="Role for Contact: {!contact.firstName} {!contact.lastName}" for="contactRole"/>
<apex:inputField id="contactRole" value="{!role.role}"/>
</apex:panelGrid>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Sample code provided by salesforce.com. All rights reserved.