background preloader

Visualforce

Facebook Twitter

Controller - Multiple custom objects in a single VisualForce page. I would probably create a Custom Apex Controller with a reference to both objects and action methods to handle the two different save actions you wish to run, the main reason being that you wish to show lists of objects as well as create a single record. Using a standard controller + extension really just confuses things since you have a bunch of functionality you won't need specific to only a small part of the data you interacting with. When you say 'show all of their records on the same page', you need to be more specific about 'all'. Force.com has many constraints around the size of lists, size of SOQL query result sets and the size of the view state so you are probably constrained to lists of 10 if you attack the problem naively by querying everything and storing it in a list.

If you want to handle large list sizes you need to look at Standard Set Controllers, if you are looking at a small list then you should expose a List. Either way you can use or / to render the list. Editing Multiple Records Using a Visualforce List Controller. Problem You need to edit a set of records at the same time. A standard detail page, though, only allows you to edit one record at a time. Solution Create a Visualforce page using a standard list controller. The standard list controller enables you to create Visualforce pages that can display or act on a set of records.

To create a Visualforce page using a standard list controller to edit a list of opportunities: In Salesforce.com click Setup | Develop | Pages. Click Save. Your page should resemble the following: Editing Multiple Opportunities on a Single Page Discussion Using a standard list controller is very similar to using a standard controller. The recordSetVar attribute not only indicates that the page uses a list controller, it indicates the variable name of the record collection. In this example, two fields, Stage and Close Date are displayed for edit in the table.

An Introduction to Visualforce. Visualforce is the component-based user interface framework for the Force.com platform. The framework includes a tag-based markup language, similar to HTML. Each Visualforce tag corresponds to a coarse or fine-grained user interface component, such as a section of a page, or a field. Visualforce boasts about 100 built-in components, and a mechanism whereby developers can create their own components.

Visualforce uses the traditional model-view-controller (MVC) paradigm, with the option to use auto-generated controllers for database objects, providing simple and tight integration with the database. You can write your own controllers, or extensions to controllers, using Apex Code. This article introduces Visualforce. Visualforce in Action A developer creates Visualforce pages by composing components, HTML, and optional styling elements on the Force.com platform. Visualforce pages can react differently to different client browsers such as those on a mobile or touch screen device. APIs Here: Introduction to Visualforce. Hands-on Training: Get Started with Visualforce for Admins.

Pushing Visualforce to the Limits, Without Apex.