

#1.3.9 PRACTICE COMPLETE YOUR ASSIGNMENT ANSWERS APEX UPDATE#
Again the tag causes the menu to fire its action whenever the selected value changes, and again it uses reRender="contacts_list" to update only the. The records per page selection menu uses an, which you used earlier, but instead of calling a controller method to get the menu values, we simply use elements for the desired values. This is how the Previous link is grayed out when you first load the page, but becomes active if you move forward by clicking the Next link. By using the expression in the rendered attribute, you can show or hide the results of that component on the page. Here the page markup is referencing Boolean properties provided by the standard list controller, HasPrevious and HasNext, which let you know if there are more records in a given direction or not.

The value attribute of is set to the variable loaded by the standard list controller, ? This is how Visualforce enables you to show components conditionally, that is, depending on the result of a Boolean expression.Here’s what’s going on in the table markup. Is an iteration component that generates a table of data, complete with platform styling. A new window should open, showing the standard Salesforce page header and sidebar elements, and a list of your contacts.

Click Preview to open a preview of your page that you can look at while you make changes.In the editor, replace any markup with the following.Open the Developer Console and click File | New | Visualforce Page to create a new Visualforce page.To make it obvious, the primary differences are highlighted in bold in the following sample. The markup for using the standard list controller is almost identical to using the standard, one-record-at-a-time controller. This sounds complicated in words, but you’ll understand it quickly when you read the markup. An iteration component loops through its collection, and for each record, generates some output based on a template you provide as part of the component markup. An iteration component works with a collection of similar items, instead of on a single value. The standard list controller is similar, except instead of a single record, it loads a list, or collection, of records into the variable.īecause you’re dealing with a collection, instead of an individual record, you need to use an iteration component to display them. The standard (record) controller makes it easy to get a single record loaded into a variable you can use on a Visualforce page.
