It is very handy to disable buttons after they have been pressed. This lets the user know that the button was in fact pressed, and it prevents the button’s action from being executed multiple times. The Visulforce component apex:actionStatus gives us an easy way to accomplish this. Here are some things to take note of…
Read moreCategory: Development
Multiselect Picklists for User Search and Selection using Apex and Visualforce
Below is a component that will allow you to search and select Users. It was created to mimic the experience of selecting multiple users in the Task creation window. However, it would be easy to change the reference from the User object to almost any other object. An initial list of selected users can be…
Read moreRecord ID and Data Retrieval from a VisualForce Controller Extension without a SOQL statement
Retrieve field data for a record using the Standard Controller object in a Controller Extension class public with sharing class MyController {. Account MyAccount; Id MyId; public MyController(ApexPages.StandardController controller) { list MyFieldList; // get the record // passing a list of field names to the standard controller will cause // the standard controller to retrieve…
Read moreVisualforce Help Text and a Popup Tool Tip
Visualforce Field Help Text The help icon can be added to a Visualforce field within an apex:pageBlockSectionItem. Access the help text using the $ObjectType api. Put it in the helptext attribute of the apex:pageBlockSectionItem. {!$ObjectType.Account.Fields.Phone.InlineHelpText} Easy Hover Tooltip The following may help if you are not using the apex:pageBlockSectionItem. I’ve used this technique in the…
Read moreDefine and Initialize a Map, List, and Set in Apex
The syntax for defining a list, map, and set collection with initial values sometimes slips my mind. The lack of () throws me off, so this post is to help out my future self. List Definition public list MyList = new list {‘AAA’, ‘AAA’, ‘BBB’, ‘BBB’, ‘CCC’}; Set Definition public set MySet = new <set>{‘A’,…
Read more