When maintaining records that have required fields through a table, using regular input fields can end up with an unsightly collection of red bars striped across the table.
In this recipe, we will create a Visualforce page to allow a user to create a number of contact records via a table. The contact Last Name column header will be marked as required, rather than the individual inputs.
This recipe makes use of a custom controller, so this will need to be created before the Visualforce page.
First, create the custom controller by navigating to the Apex Classes setup page by clicking on Your Name | Setup | Develop | Apex Classes.
Click on the New button.
Paste the contents of the
RequiredColumnController.cls
Apex class from the code downloaded into the Apex Class area.Click on the Save button.
Next, create a Visualforce page by navigating to the Visualforce setup page by clicking on Your Name | Setup | Develop | Visualforce Pages.
Click...