How Do Visualforce Pages Compare to S-Controls?
Visualforce pages are considered the next-generation of s-controls and should be used instead of s-controls whenever possible, both for their increased performance and the ease with which they can be written. The following table outlines the differences between Visualforce pages and s-controls.
| Visualforce Pages | S-Controls | |
|---|---|---|
| Required technical skills | HTML, XML | HTML, JavaScript, Ajax Toolkit |
| Language style | Tag markup | Procedural code |
| Page override model | Assemble standard and custom components using tags | Write HTML and JavaScript for entire page |
| Standard Salesforce component library | Yes | No |
| Access to built-in platform behavior | Yes, through the standard controller | No |
| Data binding | Yes
Developers can bind an input component (such as a text box) with a particular field (such as Account Name). If a user saves a value in that input component, it is also saved in the database.
| No
Developers can't bind an input component with a particular field. Instead, they must write JavaScript code that uses the API to update the database with user-specified field values.
|
| Stylesheet inheritance | Yes | No, must bring in Salesforce stylesheets manually |
| Respect for field metadata, such as uniqueness | Yes, by default
If a user attempts to save a record that violates uniqueness or requiredness field attributes, an error message is automatically displayed and the user can try again.
| Yes, if coded in JavaScript using a describe API call
If a user attempts to save a record that violates uniqueness or requiredness field attributes, an error message is only displayed if the s-control developer wrote code that checked those attributes.
|
| Interaction with Apex | Direct, by binding to a custom controller | Indirect, by using Apex webService methods through the API |
| Performance | More responsive because markup is generated on the Lightning Platform platform | Less responsive because every call to the API requires a round trip to the server—the burden rests with the developer to tune performance |
| Page container | Native | In an iFrame |
No comments:
Post a Comment