11 votes
Accepted

Nested table using pageblock

You need to use breakBefore and colspan parameters of the apex:column: <apex:pageBlock> <apex:pageblocksection title="Order Lines" showheader="true" collapsible="true" columns="1"> &...
user avatar
  • 21.7k
9 votes
Accepted

'Map key null not found in map' when using apex:pageBlockTable

Things often get a bit hairy when you start to use maps of maps (or mapception :D). You can represent tables of data in this way if you change your variable model. Change the map of maps to be a ...
user avatar
9 votes
Accepted

Tooltip for <apex:column> Header Facet

If you are trying to find something like the standard UI tooltip - the question mark with a round, yellow background. You can simply use something like this: <apex:image value="/s.gif" styleClass=...
user avatar
  • 12.7k
6 votes
Accepted

pageBlockTable - row number variable is not incremented

The dataTable and pageBlockTable elements do weird things for content outside of apex:column elements (usually by way of ignoring the content entirely). If you put the counter inside a column, it will ...
user avatar
  • 439k
6 votes
Accepted

Create PageBlockTable With Two Types Of SObject

Just use a List<SObject> property. Your controller should look something like: public with sharing class MyController { public List<SObject> tasksAndNotes { get; private set; } ...
user avatar
  • 144k
6 votes

Disabling Mouse-hover-color-change for the apex:pageBlockTable

You can't "disable" it, but apparently you can countermand it. I've come up with two potential solutions. !important Use an important style. <style> .red, .red.highlight { background: red ...
user avatar
  • 439k
5 votes

'Map key null not found in map' when using apex:pageBlockTable

Here is a work around for your problem. Add null key in controller Map<String, Map<String, Boolean>> theMap = new Map<String, Map<String, Boolean>>(); theMap.put('...
user avatar
5 votes
Accepted

Display multiple List<String> objects as columns in a visualforce page

You should create a 2 dimensional array or we can say List of List which looks like List<List<String>> twoDimArray and try to iterate it like: <apex:repeat value="{!twoDimArray}" var="...
user avatar
  • 22.3k
5 votes
Accepted

How do I stop the loading indicator on the VF page?

The apex:actionSupport tag has an oncomplete attribute where you can call another JavaScript function that sets the display attributes to 'none'. That call is performed when the AJAX request has ...
user avatar
  • 131k
5 votes
Accepted

Retrieving an image from rich text field?

Rich fields are stored as HTML in Salesforce, so to retrieve your image, you will have to parse the text and get the image from there. Luckily this is a fairly simple task to do. Once queried, the ...
user avatar
5 votes
Accepted

Dynamically Create Columns in Block Table From Object's Fields

The problem is the dot in here making the page compiler expect a field name immediately after the dot: {!prod2.[fieldAPIName]} Should work without that: {!prod2[fieldAPIName]} Fyi, here is a ...
user avatar
  • 131k
4 votes
Accepted

Visualforce pageblocktable view of opportunities in account view - how to control the order?

Is there any way, from professional edition salesforce (no custom controllers or classes) to control the order that these opportunities are showing up in the table? If you cannot query for them ...
user avatar
  • 23.6k
4 votes
Accepted

Add a "button" next to a column header

You can use apex:facet to do this. <apex:column> <apex:facet name="header">Priority <apex:commandLink action="{!action}" value="Go!"/></apex:facet> {!1} </apex:...
user avatar
  • 13.3k
4 votes
Accepted

Display repeat data in a table

The apex:pageBlockTable tag, like the apex:repeat tag, is an iterating tag that also takes a value and a var attribute. More here: http://www.salesforce.com/us/developer/docs/pages/Content/...
user avatar
  • 6,191
4 votes
Accepted

Reference a child field in grid or create grid from standard controller

You can indeed reference a child in pure Visualforce. Note that if you want just one record, you don't get to choose which one will be displayed (it will probably be the oldest record, but no ...
user avatar
  • 439k
4 votes

pageBlockTable - row number variable is not incremented

According to this page, it is unsupported. Though most of us have used it inside of an <apex:repeat> without problems, I suspect that the VF engine works differently in an <apex:...
user avatar
4 votes
Accepted

Scrolling in Pageblocktable

Quickest way to do this would be to use StickyTableHeaders. (Most reliable solution I have used) and provides the most standard like UI compared to other solutions. Datatables.net is also a great ...
user avatar
  • 53.2k
4 votes
Accepted

Attempt to de-reference a null object - Wrapper list

The only value that can be null at the line you indicate is wrapAccountList and that is entirely possible even if it was initialised earlier because it is marked as transient and so will not have its ...
user avatar
  • 131k
4 votes

Rowspan with apex repeat

Examples such as this one HTML rowspan Attribute reduce the number of td elements in the following rows (as rowspan is effectively saying use the content from the previous row). So you need to ...
user avatar
  • 131k
4 votes
Accepted

Visualforce Display and Hide Fields

You could remove apex:PageBlockSection and then add rendered condition in apex:column for 3rd pageBlockTable as follows <apex:pageBlock> <apex:pageBlockTable value="{!AFields}" var="...
user avatar
4 votes
Accepted

SelectList in PageBlock Table is not working as expected

The issue you are having is here: <apex:pageBlockTable value="{!lineItems}" var="items" > ... <apex:column headerValue="Select Commodity"> ...
user avatar
  • 63k
3 votes
Accepted

Title for each records in pageblocktable

You can use an apex:repeat to output lots of headers with a table inside each. Here is an example using standard objects where for each Contact there is a table of Cases: <apex:page ...
user avatar
  • 131k
3 votes

How to restrict a column to display value if value exists

You can in fact used the rendered attribute to do this. For the : <apex:pageblocksection title="Order infos" showheader="true" collapsible="true" columns="1"> you need to put logic in the ...
user avatar
  • 6,059
3 votes
Accepted

New records not getting inserted in a list, when pagination is used in getter method of list

Your Add/AddMore method appends the new object to the records list but when the re-render causes getrecords to be called you overwrite the records list with the objects queried from the database which ...
user avatar
  • 131k
3 votes
Accepted

StandardController of Account to show a pageblocktable of related child object from an extension errors out

The problem is that the Visualforce page compiler assumes the "record" in {!record.Competitor_Product__c} is the return value of the getRecord method of the standard controller rather than the var="...
user avatar
  • 131k
3 votes
Accepted

apex repeat on multiple list values with one common id

I definitely think the wrapper class is the way to go; I use this method a lot especially as it helps to avoid view state issues. I would recommend not showing record Ids, and instead provide a ...
user avatar
3 votes

apex:pageBlockTable conditionally rendered rows

On top of the head i can think of 2 ways, i am not sure if these are the right way to do it and i havent tried it out myself so i might be wrong. You could use the rendered attribute in apex:column, ...
user avatar
  • 12k
3 votes

'Map key null not found in map' when using apex:pageBlockTable

One workaround I have found (which keeps the column headers intact) so far is to add a getHeaders method to my controller and change my apex:repeat definition. Whilst this works perfectly in this ...
user avatar
  • 13.3k
3 votes

SOQL Inner query pageblocktable

There can be two solutions Apex based:- retrieve all related records in apex and then perform aggregation in apex. Basically, extract all required records and their references (completed or ...
user avatar
  • 2,569
3 votes
Accepted

Sorting apex:pageblocktable

Follow the steps in this link to fix the sorting on apex:pageblocktable. It uses the jQuery tablesorter plugin to sort the table client-side. <apex:page standardController="Opportunity" tabStyle="...
user avatar
  • 13.3k

Only top scored, non community-wiki answers of a minimum length are eligible