New Visualforce Features in Winter ’12

One of the biggest pilots we have in Winter ’12, Visualforce Charting – has a great overview here by Michael Alderete. I’ll be digging into Charting some more myself in the near future – but if you haven’t cracked open a pre-release org and tried it out for yourself … you really should.

Another trick which will come in handy for owners of massive datasets is the ability to set ReadOnly on the page component itself. Like the Apex counterpart – this allows the page to dedicate itself to reading data and instead of the normal limit of 50,000 you can handle up to 1 million rows of data (insert Doctor Evil joke here). This is based on the Apex annotation of the same name, but allows you to apply the rule to an entire page instead of having to specify controller methods.

You can specify the attribute in the page component:

<apex:page controller="SummaryStatsController" readOnly="true">
    <p>Here is a statistic: {!veryLargeSummaryStat}</p>

Naturally, it’s not quite as simple as being able to query into a million row dataset and tossing that information to the user in a massive table. The repeat component is normally limited to 1,000 rows – but the readOnly annotation will also bump this up to 10,00 rows … allowing you to still use the convenience of Visualforce tags and also representing more data to the user.

Another option is to utilize JavaScript Remoting with libraries such as jQuery UI. This would allow you to leverage larger sets of data for widgets which can handle it – such as SlickGrid. Another example which may benefit from increased limits is the “infinite scrolling” setup demonstrated by Mavens – a UI effect which is growing in popularity with applications like Facebook and Twitter.

JavaScript Remoting
Speaking of JavaScript Remoting – there’s now the possibility to set your annotated methods as public. This will come as a great relief to some ISV’s who have been looking to use JavaScript Remoting in packages but would prefer to not have all the logic declared as global. There are restrictions, though. Basically public methods can’t be accessed via global means – whether that be globally defined components or within an iframe (which includes embedding Visualforce into a page layout). A normal Visualforce page can fully utilize the public JavaScript Remoting however.

Remoting also now supports returning most common data types. I’ll have a follow up post outlining some code samples for sending data with JavaScript Remoting using sObjects and custom Apex classes.

Custom Doctype
I wish we had gotten this feature out about a year ago when most HTML5 browsers were more hardcore about detecting the Doctype for specific features – but I’ll still take this particular gem. Now you can define specific doctypes within the page component for the browser to display, rather than default HTML transitional. This includes variants for HTML4, HTML5 and XHTML – making developing pages for specific browsers, HTML5 traits or CSS targets much easier for developers.

Go Forth and Register

To start working with these updates now, register for a pre-release org to try them out.  Some of the features, like Visualforce Charting, you will need to contact Salesforce to enable.  To get more information on Winter 12, check out the release site, the release notes or see the version 23 preview documentation.  You can also shoot me questions via twitter @joshbirk.


September 29, 2011

Leave your comments...

New Visualforce Features in Winter ’12