Skip to main content
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
  • 151k
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
  • 497k
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
  • 136k
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
  • 136k
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
  • 54.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 ...
Keith C's user avatar
  • 136k
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
  • 136k
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
  • 72.1k
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.8k
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
  • 151k
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

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.7k
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,167
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
  • 151k
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
  • 517
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
  • 23k
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
  • 497k
3 votes
Accepted

Joining a list of strings and a list of integers in a table

Most people use a "Wrapper" to combine the elements into a single list. You can do this: public class tableextension { public class Wrapper { public Integer intValue { get; set; } ...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

Why is save method not working for one VF page but works for the other?

Your code updates the list of child records from the parent record: update i.Interview_Questions__r; But you're editing q: <apex:pageBlockTable value="{!q}" var="ques" > ...
sfdcfox's user avatar
  • 497k
2 votes

control the pageblocktable visibility

Add a property to your controller that checks the values selected in the 3 dropdowns: public Boolean renderTable { get { return !String.isEmpty(dropDown1) && !...
Keith C's user avatar
  • 136k
2 votes

PageBlockSection with 4 columns

Another method is to create a table (as many columns as needed). Embed a pageBlockSection columns="1" within each table column. This still compressed the labels a little, so I used styling as well. ...
Nicholas Koopman's user avatar
2 votes

Retrieving an image from rich text field?

Try below code, <apex:pageBlockTable value="{!con}" style="width:1200px;" var="c" rendered="{!if(showPB==true,true,false)}" border="2" title="Some Name"> <apex:column> <apex:facet ...
Victor's user avatar
  • 3,591
2 votes
Accepted

Data not rendering in Visualforce page

You are assigning the query results to a local variable not the property of the same name: List<Design_Atelier_Quote__c> daQuoteList = [SELECT ...]; Removing the type part will stop the line ...
Keith C's user avatar
  • 136k
2 votes

How to show a relatedlist using output text field

Just add this style to your page: .actionColumn { display: none; } The following works for me: <apex:page standardController="Account" renderAs="pdf" showHeader="false" sidebar="false" ...
Adrian Larson's user avatar
  • 151k
2 votes
Accepted

Apeax pageblock buttons showing space on left side of the panel

The apex:pageBlockButtons is used to create that button section on the top and/or on the bottom of the pageBlock. If you don't want that behavior, simply add the buttons to you page without using the ...
Fernando Gavinho's user avatar
2 votes
Accepted

Add delete button in a pageblock table

The docs say apex:param is "A parameter for the parent component" so move it to within i.e. <apex:commandButton> in here </apex:commandButton>. If the ID is set correctly the table may be ...
Keith C's user avatar
  • 136k
2 votes

Create PageBlockTable With Two Types Of SObject

Although I like Larson's answer above, I think it is better to organize the data in the Apex layer, and minimize the logic in the presentation/VF layer. In this case, you could make a custom object ...
SeanW's user avatar
  • 702
2 votes
Accepted

Rerender Error, with controller extension

Don't use a merge field for your rerender attribute. Just use a literal value. Incorrect: reRender="{!covenanttable}" Correct: reRender="covenanttable" When you use a merge field, the markup then ...
Adrian Larson's user avatar
  • 151k

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