,

Overriding Views with Visualforce Pages

You like your new Visualforce list view a lot – so much that you’d like to use it instead of that standard view that your user community sees when they click on the Job Applications tab. Since you have added the ability to use predefined user filters, your users will like the new version too. You can accomplish this task easily.

1.
Go to Setup Create Tabs.

2.
Click New in the Visualforce Tabs section, which will bring up the page shown in the figure below.

Figure 169. Adding a Visualforce tab


3.
Select the Visualforce page you have been working on, JobApplications, as the Visualforce Page.

4.
Give the tab the label of New Job Applications.

5.
Change the name of the tab to NewJobApps, since you will want your new Visualforce page to highlight this new tab, as you will see shortly.

6.
Select the same Hands icon you used for the original Job Applications tab.

7.
Click on Next to accept the default security on the tab, and deselect all of the applications except for Recruiting, and click Save.

When you see your application, you can see the tab you just created.

8.
Click on the tab to bring up your Visualforce page.

It works—almost perfectly. The one problem is that when you bring up the Visualforce page, the original Job Applications tab gets the highlight. This result is because of the tabstyle attribute in your page—one you can easily change.

9.
Change the value for the tabstyle in your page to NewJobApps__tab. A tab is identified by the tab name, followed by two underscores and the word tab.

10.
Click on the second Job Applications tab again and see how well it works now.

11.
At this point, you would probably want to at least remove the original Job Applications tab from the Recruiting applications, to avoid confusion.

You were able to use standard set controllers to implement most of the functionality of a list view, with quite a bit more flexibility. Your users will be able to use the list in the Job Application to see the job applications with extended information about each application, as well as giving them simple one-click access to the application or the position and candidate the application pulls together.

So far, you have seen how standard set controllers can be used to extend the reach of read-only lists. But, as you will see in the next section, Visualforce pages based on these controllers can also implement functionality that will transparently act on a group of selected records.

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

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