,

Displaying Positions

The first page of your wizard displays the Positions records retrieved by the SOQL statement you just created in your custom controller. Since you have had some experience defining Visualforce pages already, you will recognize almost everything in the code for this page:

<apex:page controller="customController">
    <apex:sectionHeader title="Interview Scheduler"
      subtitle="Step 1 of 3 - Select Position"/>
    <apex:form >
        <apex:pageBlock mode="edit">
            <apex:pageBlockSection columns="1">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel
                      value="Select an open position: "
                      for="openPositionList"/>
                    <apex:selectList
                      value="{!selectedPosition.ID}"
                      id="openPositionList" size="1">
                        <apex:selectOptions
                          value="{!openPositionList}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton
                  value="Get candidates" action="{!step2}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

You have already encountered the pageBlock, sectionheader and pageBlockTable in this chapter and Chapter 9: Visualforce Pages. The only new aspect of this page is in the initial page tag. Instead of having a standardController attribute, the page has a controller attribute that points to the name of the Apex class acting as the custom controller for the class.

This page has been loaded into your organization as part of the initialization procedure for this chapter, as described at the beginning of this chapter, under the name of wizard1.

Run this wizard1 page by appending /apex/wizard1 onto the base URL for your instance, which should be http://c.instance_name.visual.force.com, where instance_name is replaced with the name of your Force Platform instance. You should see the page shown below.

Figure 196. The first page of your wizard


Your Visualforce page looks just like other Visualforce pages—the only person who knows that there is a custom controller at work is you. This result is nothing but positive. You can supplement or replace standard controller functionality without changing anything in your Visualforce page, aside from pointing the page to a different controller.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.63.191