11

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"> <apex:pageBlockTable value="{!accounts}" var="a"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.Street__c}"/> ...


10

I would have to presume that the problem stems from the data appearing as an actual string to the sorting algorithm, thus producing lexicographical sorting (e.g. sorting as a string). You have plenty of choices to choose from if you want to introduce easy sorting: AngularJS has an orderBy directive, jQuery has a tableSort, module you can add into it (and ...


10

You have the wrong format for the label merge field, hence nothing is being displayed. If you used <apex:outputLabel value="{!$Label.Name}"/> you'd see the error. The value you're trying to display is for custom labels that are defined at an org level. You can fix this by using {!$ObjectType.Account.Fields.Name.Label}. That said, if you are trying to ...


9

You'll find that it's not recommended to use PageBlockSection with more than two columns. You may be better off writing your own HTML as you'll be able to style it more precisely. "Salesforce stylesheets are optimized for either one or two columns." ( https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockSection.htm )


9

I have a simple example for you, where you can add entries to the list and show this list on the visualforce page and separately remove these entries. This looks like this: The idea is to use an extra variable to define a row number to remove. Try to reproduce my example and use the logic in your code: Class: public with sharing class test1 { public ...


9

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 list of a new inner class that contains simply the name of the inner property and a map of the outer properties to boolean values. Also add a method to retrieve a ...


7

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="helpIcon" title="{!$ObjectType.Order__c.Fields.Division__c.inlineHelpText}" rendered="{!$ObjectType.Order__c.Fields....


6

I have followed the steps in this link and I was able to fix the sorting on my apex:pageblocktable. It uses the jQuery tablesorter plugin to sort the table client-side. <apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="myext" id="thepage"> <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10....


6

Just use a List<SObject> property. Your controller should look something like: public with sharing class MyController { public List<SObject> tasksAndNotes { get; private set; } public MyController() { tasksAndNotes = new List<SObject>(); tasksAndNotes.addAll([SELECT ... FROM Task WHERE ...]); ...


5

apex:actionFunction has an oncomplete attribute where you can specify JavaScript to run once the partial page update has completed. So you will need to move your DataTables setup code into a function that can be called from there as well as the page ready event so the DataTables JavaScript is run after the Ajax update. (Personally I try to avoid putting ...


5

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('Outer 1', new Map<String, Boolean> { 'Inner 1' => true, 'Inner 2' => false }); theMap.put('Outer 2', new Map<String, Boolean> { 'Inner 1' ...


5

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="dimension1"> <apex:pageBlockDataTable value="{!dimension1}" var="dimension2"> <apex:column value="{!dimension2}"/> <!-- etc --> ...


5

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 work: <apex:page controller="counter"> <apex:variable value="{!0}" var="index" /> <apex:pageBlock> <apex:pageBlockTable ...


5

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 completed.


5

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 field will look like this in the variable: What you want is what is in the src attribute of the img tag. You can just copy the tag, or get the link and remake it ...


5

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 slimmer version of the code: public class MyController { public Product2[] products {get; private set;} public String[] fields {get; private set;} ...


5

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 !important; } </style> This will override the Salesforce style sheet. Toggle "highlight" You can also remove the class as its added: <apex:...


4

I took the Account example from your first link, and changed each Account reference to lead. EDIT: From the doc page you link above, "This page does not specify a filter in the request, so the page is displayed with the last used filter." In my testing, my last used Lead filter happened to be "All Open Leads". If your last used filter shows no leads (e.g.,...


4

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 in the order you want - tricky. Your best course of action might be to include a client-side formatting & sorting solution such as http://datatables.net ...


4

This controller: public class MyController { public Map<String, List<String>> myMap { get { return new Map<String, List<String>>{ 'abc' => new List<String>{'123', '456'}, 'def' => new List<String>{'654', '321'} }; } } } ...


4

You have {...} rather than (...) surrounding your IF condition, switch those and it should (hopefully) work. <apex:pageBlockTable value="{!list}" var="d"> <apex:column style="{!IF(!(d.manager == 'user1)','background:rgb(243, 171, 171);', '')}" > <apex:facet name="header"> <apex:commandLink value="Name"/> ...


4

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:column> There is more detail on apex:facet in the documentation.


4

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/pages_compref_pageBlockTable.htm If you swap out your repeat for the pageBlockTable, you would get something like: <apex:page standardController="...


4

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 guarantees are given). Here's how you could remove the extra variable by way of using the query: <apex:page Controller="DecomController"> <apex:form > ...


4

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:PageBlockTable> and the counter does not get incremented.


4

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 resource if you want to add search and filtering. I like it much better that jQuery data tables. https://github.com/jmosbech/StickyTableHeaders Here is a MVR ...


4

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 value restored when the next action runs. A quick fix is probably to remove the transient, but other restructuring of the controller may make more sense.


4

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 modify your code to only output these td elements once in every 3 rows: <td rowspan="3">{!fd.Business_Devision__c}</td> ...


4

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="Additional"> <apex:column headerValue="Product"> <apex:inputField value="{!Additional.Product__c}"/> </apex:column&...


3

A good way to test this is to look at the generated debug SOQL at the bottom of the page and then run it in SOQL Xplorer or something. This will give you a good indication what is going on under the hood. For instance, when I entered 60 into the Amount field, the generated SOQL is: select name, accountid, amount, closedate, forecastcategoryname, ownerid ...


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