Techtalk visualforce components deepdive FAQ

Tech Talk: Visualforce Components Deep Dive Webinar FAQ

This is the FAQ for the webinar: Tech Talk Series: Visualforce Components Deep Dive. To learn more about Visualforce, please visit our Visualforce page on Developer Force.

Contents

Q: Can you address Visualforce email components? Specifically bringing in merge fields from multiple objects?

A: Visualforce Email Templates do not currently allow Controllers that would allow fields from multiple objects to be used, so this is not supported today.

Q: Can a component be reused after install and be reused in a extension package with a different name space

A: Yes, but custom components can be restricted, using the access attribute, to run only in your namespace.


Q: Is Ext being considered as a standard JS library for Force development?

A: Ext is one of many frameworks that can be included in Visualforce pages or components, others are Adobe Flex and Dojo.


Q: Are there any limitations to Visualforce pages that are utilized in 'sites' vs. those that are 'internal' ?

A: No, the Visualforce pages are the same if they are shown in Sites or not.


Q: Will we get the source for the examples as well as the presentation slides? Where?

A: Sure, keep an eye out on the blog. Also, the RSS feed code is on Code Share


Q: Are we going to have a custom component marketplace?

A: This is a great idea for the idea exchange. There is a example category in AppExchange today if you wanted to share components.


Q: Can you lock a custom component so that other people cannot change it? Similar to the managed packages in Apps?

A: Yes, custom components will be obfuscated when you upload as a Released Managed Package.


Q: I'm well versed in the limits placed on Triggers (DML and lines of code run)... what are the apex limits we should be aware of when a Visualforce page loads with custom components on it?

A: limits add up, so if you add a component, it's will count against your limits


Q: Can you Talk About Unit Test/Test Coverage for the component?

A: The controller must have test coverage just like any other Apex class


Q: What are the plans for including inline editing within Visualforce pages?

A: Enable Developer Mode under Personal Information to activate the inline editor.

Q: Are there any advantages for internal developers using Visualforce vs java? Why would I want to build something in Visualforce vs Java?

A: Java does not run on the Force.com platform, if you are developing an app on Force.com you would build the UI in Visualforce.


Q: If DML work inside component, why is there an allowDML attribute for <apex:component>. And I got error when upserting inside component controller. thanks in advance.

A: This is required to ensure that the component designer understands the possibility of side effects from doing DML in the component, and that they are aware that other components on the same page should not make DML on the same object


Q: Do you have any sample code to walk us novices through that please?

A: http://developer.force.com has lots of resources and samples


Q: can components used to make the Visualforce page respect pagelayouts and FLS?

A: Yes they do


Q: Since Customer Portals do not have a UI access to opportunities, can I use a Visualforce tabs to get around this limitation?

A: Yes but security controls prevent you from writing to opportunities, but you can read from them.


Q: Can components make web service call outs?

A: Yes - the customer controller can make the web services callout.


Q: My Visualforce page has an output link to call some JavaScript. Is there a way that the JavaScript's alerts can be thrown in the browser while still viewing the Vf page?

A: Sure, alerts can be called at any time


Q: About component's controller, will it be reset after navigating to a new page?

A: Not sure what you mean by re-set, but a new instance is created on each postback


Q: Can I have sample file to link to static resource.

A: You can upload pretty much anything as a static resource -for example an image


Q: I'm a seasoned Java Developer but new to SalesForce/VisualForce. Is there a long learning curve? How long should it take for me to get up to speed with VisualForce

A: It shouldn't take long. Apex has a syntax that isn't far from Java, and Visualforce is similar to many UI component libraries. See the Core Resources to get started


Q: Can a component trigger a partial page refresh? (AJAX)

A: Yes


Q: Can a component talk to another component on the same page?

A: Yes, via the $Component variable which gives you the component name


Q: Will the CSS of component over-write the page css?

A: Standard CSS rules apply, you can chose to have your css override or not


Q: I've been developing some VisualForce pages and I have a feeling they are slower to load, compared to native SF pages. Is this the case?

A: I haven't noticed this. I have noticed that when I'm developing and using the inline editor that it's a tad slower, but that's the browser having to load and run the editor.


Q: if you use the same component multiple times, is the CSS and javascript loaded each time?

A: No, it's not


Q: can I include my custom css, JavaScript, HTML in Apex page?

A: Yes


Q: Where does the <c: come from?

A: It is an implicitly namespace that maps to your own internal custom components


Q: If I understand correctly, once values are bound to data from the page/copntroller, that data is then set/available in the page controller for any custom logic?

A: Yes


Q: From apex code, I would like to access a local SQL database or SOAP Web services. How would I access data from my intranet?

A: Expose your local data as a web service, which can be called from Force.com. See Integrating with the Force.com Platform for more.


Q: Can a Visualforce page include 2 Components, with One Component utilizing another Component's Value on page Load?

A: Yes, components can refer to each other using the $Component global variable


Q: I mean what if I want too refresh a component on change of value of another component in a Visualforce page? Is it possible, is there any sample available, to the max I searched out I got stuck with a logical snswer as on Page Load the Value selected in a Component CANNOT be passed into the component's controller class's constructor ?

A: You would pass values from the main page controller to both components, so they would share that value


Q: Is the page consumer ever the same person as the component author, or is this rare?

A: It all depends on how you set up your development teams. The nice thing with components is that it allows you to separate the two.


Q: If the sames static resource (i.e. stylesheet / script) is referenced in multiple custom components will it be consolidated into a single include in the header or included multiple times - i.e. once for each reference?

A: Yes it will translate into a single include