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 ...
sfdcfox's user avatar
  • 481k
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; } ...
Adrian Larson's user avatar
  • 149k
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 ...
sfdcfox's user avatar
  • 481k
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 ...
Keith C's user avatar
  • 135k
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 ...
Renato Oliveira's 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 ...
Keith C's user avatar
  • 135k
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 ...
sfdcfox's user avatar
  • 481k
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:...
Sebastian Kessel's 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 ...
Eric's user avatar
  • 54k
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 ...
Keith C's user avatar
  • 135k
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 ...
Keith C's user avatar
  • 135k
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="...
Santanu Boral's 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"> ...
cropredy's user avatar
  • 69.9k
3 votes
Accepted

Radio button not in sync with each other

You have List with one radiobutton element for each record. Try to use html : <apex:pageBlockTable value="{!account.Cases}" var="exscases"> <apex:column headervalue="Cases"> <...
Ilya Lepesh's user avatar
  • 4,115
3 votes
Accepted

Include radio button for each row in PageblockTable

Few days back I also have same problem. To resolve I use below steps: I created an inner class in which I store the name (Label of Radio button). class ContactName { String name; } Create a ...
Anurag Bhardwaj's user avatar
3 votes

Is there a way to create something like apex:pageBlock using Lightning Components

The short answer to your question is this: there is no analog to apex:pageBlock or its child tags in Lightning Components. As you know, the pageBlock family of tags in Visualforce gave developers ...
pchittum's user avatar
  • 19.6k
3 votes
Accepted

Adding Child query to related query

To query for child CaseComment records in your extension: oppCases = [SELECT (SELECT CommentBody FROM CaseComments) FROM Case WHERE ...]; Then in your markup: <apex:repeat value="{!cases}" var="...
Adrian Larson's user avatar
  • 149k
3 votes
Accepted

Select Records in pageblocktable using a checkbox

There is a very good example by Jeff. You can take reference. Controller Code public with sharing class PagingController { List<categoryWrapper> categories {get;set;} // instantiate ...
Tushar Sharma's user avatar
3 votes
Accepted

Change the color of the rows in the table

You can use style attribute for the column cell as: <apex:column value="{!school.Student_to_Teacher_ratio__c }" headerValue="Student to Teacher ratio" style="{!IF(school....
Ashwani's user avatar
  • 22.6k
3 votes

Export Visualforce Page in Excel as .xlsx and not as a Web Page.

The content of the page must be tabular format to be displayed as excel file. You can make sure of that as follows Remove the sfdc html/style coponents <apex:page standardStylesheets="false" ...
ipradhansk's user avatar
  • 2,317
3 votes

Sorting a pageBlockTable on a VF page

Please see ORDER BY for specifics, but basically, somewhere in your code, you have a line of code that probably looks like: List<Training_Certification__c> trainCertRecords = [SELECT Id, ...
sfdcfox's user avatar
  • 481k
3 votes
Accepted

Pageblocktable to be rendered as table in PDF

The PDF renderer sensibly skips a lot of styling as the usual Visualforce look isn't something that you're going to want on paper. The pageBlockTable should work but in these situations I do prefer ...
Matt Lacey's user avatar
  • 25.4k
3 votes
Accepted

question on using pageblocksection

I am not sure what is inside your interviewSkillReviews in your controller class. But in order to achieve your result, you will need something like this. In your apex controller: List<skillHelper&...
Lance Shi's user avatar
  • 13k
3 votes
Accepted

Capitalizing 1st character of each word in <apex:pageblockTable

It should be possible to manipulate a single value using just merge syntax: <apex:column value="{!UPPER(LEFT(mw.name, 1)) & MID(mw.name, 2, LEN(mw.name))}" /> Here is a more elegant ...
Adrian Larson's user avatar
  • 149k
3 votes
Accepted

How to dynamically create a blank row in apex:pageBlockTable if the List is blank

If you want to display a message, you can easily do that as below. Use a <apex:outputText to show the message and rendered it based on the list size rendered="{!contacts.size==0}". I used an HTML &...
Saroj Bera's user avatar
  • 14.6k
3 votes
Accepted

Maintaining state across dynamically generated pageBlockTables

I have a feeling it may have to do with the fact that you are declaring an <apex:variable /> inside the repeater. I changed the object model a little and that is no longer necessary. This ...
dana's user avatar
  • 1,067
3 votes
Accepted

Visualforce apex:column can't see record ID in rendered attribute; Hide empty column in pageBlockTable

You don't need a map at all. Just reference the empty property as in Is it possible to test list size from a VisualForce page? <apex:column ... rendered="{!NOT(qli.QuoteItemMaintenanceUplifts__r....
Adrian Larson's user avatar
  • 149k
3 votes

How to iterate Map<string,List<string>> in vf page

This will work.. Replace your VF page with the below code It's working copy.. I have used html table.. <apex:page controller="MyController"> <table> <apex:repeat value="{!...
RKM's user avatar
  • 497
3 votes
Accepted

Remove(substring) doesn't remove table rows permanently

This solution doesn't allow for scenarios such as 'undo'... but it'll delete the record removed from the table's collection, immediately. public void cancel() { rowNumber = Integer.valueOf(...
Mark Pond's user avatar
  • 22.9k
3 votes
Accepted

Visualforce jQuery Works when Hardcoding the Value, but Doesn't Properly Run Within Function

jQuery uses normal CSS selectors-like syntax. It doesn't know that "i" is a variable that should be used, nor can it directly know this. Instead, you can use a template string: $(`.dummytableid th:eq(...
sfdcfox's user avatar
  • 481k

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