Hot answers tagged

12

"{!IF(AND(relation.First_Contact__c != null, relation.First_Contact__c != contact.Id), true, false)}"


9

I found an easy solution for the problem, no need to implement any logic for the same just included the following attribute -fs-table-paginate: paginate; in tables style tag and worked like a miracle.


8

I rethought and this seems the best way so deleting the previous contents: Create a map<account,index> Put the account, index and also populate the last index in your method, and check if the index = last index and render the , Page: <apex:page controller="testing_repeat_controller" sidebar="false"> <apex:repeat value="{!Itemsforuser}" var=...


8

I'm fairly certain that you need a getter on each of the properties of your sub-class. global class AttachmentModel { public ID Id { get; private set; } public DateTime CreatedDate { get; private set; } public String FileName { get; private set; } public String Description { get; private set; } public String ParentId { get; private ...


7

Yes, you just need to wrap the output in something you can render selectively such as an outputpanel. <ul data-role="listview" data-filter="false"> <apex:repeat value="{!Proposals}" var="item"> <apex:outputPanel rendered="{!item.LineCount > 0}"> <li> <a href="{!$Page.aa_rg_jm_proposal}?id=...


7

The original question asked how many records can be iterated, to which my answer is below. It seems that for all practical purposes, you are only limited by Viewstate/CPU/Heap when taking this approach. Here is an extreme example where I was able to iterate a collection of one million items with no error. There is no output, and there is hardly any data. ...


7

I could think of preparing data based on SOQL query using GROUP BY ROLLUP I have replicated the data at my DE and following SOQL query is giving the exact formatting and summation which you are trying to achieve. SELECT GrandParent__c, Parent__c, Child__c, SUM(Weight__c), SUM(Workout_Hours__c) , GROUPING (GrandParent__c) grpGrantPt, GROUPING(Parent__c) ...


6

What you are looking to do is not possible. From what I understand, basically you would prefer to do something like this: <apex:repeat value="{!keyList}" var="key"> <apex:repeat value="{!functionToGenerateList(key)}" var="val"> // do some stuff related to the val </apex:repeat> </apex:repeat> Unfortunately, this isn'...


6

One possible non-jQuery solution: <script> function findParent(el, tagName) { tagName = tagName.toLowerCase(); do { el = el.parentNode; if (el.tagName.toLowerCase() === tagName) { return el; } } while (el.parentNode); return null; } function highlight(...


6

You need to use outputText instead of outputPanel. outputPanel is intended to be used as reRender targets, and to group content together. The documentation for outputPanel states: A set of content that is grouped together, rendered with an HTML <span> tag, <div> tag, or neither. Use an <apex:outputPanel> to group components together for ...


6

You've got a few problems here. First, "total" isn't the ID of the repeat element in the traditional HTML sense. I'm pretty sure it doesn't even get rendered into the final HTML, so JavaScript can't see it. Normally you'd use id values on Visualforce elements to reRender it, not do something in JavaScript to it. Second, even if the repeat did have an id, ...


6

I will take this approach to prepare the structure like this: 1) Create a ContactWrapper with all the Contact attributes. 2) In getData() method, retrieve the Contact List firing SOQL query and prepare the desired map i.e. mapModule which contains ModuleName as Key and List<ContactWrapper>. In that method, prepare a List of ModuleNames from ...


5

You don't need to put "get" as it's resolved implicitly by Salesforce (getter methods are called as properties). so you should be able to use:- <apex:repeat value="{!Attributes}" var="att"> </apex:repeat>


5

Because you are referencing these in a VF page, the variables need to have getters public String partNumber {get; private set;} public String serialNumber {get; private set;} public String assetName {get; private set;}


5

Getters and setters may be called more than once. This is determined by the compiler and can't explicitly be forced. Generally, if you're doing anything in a getter, you should be caching the results, and returning that cached value when possible. Typical example: transient SelectOption[] myPicklistCache; public SelectOption[] getPicklistOptions() { if(...


5

Use in the repeat caseInfo.CaseNumber Since caseInfo is akin to the loop variable in a for loop and each instance would be a wrapper record When using the repeats think of each one as a for loop. Maps are accessed using [keys] and values are accessed using dot notation. The var is the loop variable Working example: Controller public class ...


5

You don't need to pass it to Apex. Just use the $ObjectType global variable. Here I will rename your variables to be less confusing and conform to your description. Please also note it's label, not lable. <apex:repeat value="{!selectedFields}" var="fieldName"> <apex:facet name="header"> {!$ObjectType.MyObject__c.fields[fieldName]....


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

I think a more elegant solution would be to render items as an unordered list and then use css to render the commas. <style type="text/css"> .cs-list { display: inline; list-style: none; padding-left: 0px; } .cs-list li { display: inline; margin-left: 3px; } .cs-list li:after { content: ", "; ...


4

Unfortunately you can't use the apex:tabPanel with the apex:repeat as you tried: apex:repeat This component can't be used as a direct child of the following components: <apex:panelBar> <apex:selectCheckboxes> <apex:selectList> <apex:selectRadio> <apex:tabPanel> Based on this, you can use tabPanel only in non-dynamic ...


4

While you can have some logic within repeat tags, you can't include literal Apex Code. You could, however, achieve this with either JavaScript (albeit clumsily), or by rendering this data with a wrapper class and some helper functions. You'll see you have to use "formula-like" constructs, so it has some limitations (e.g. you can't get the a string into an ...


4

The child relationship name has to be observed and __r needs to be appended . In your set up menu navigate to Object > field > and observe child relationship name


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


3

What you want to do requires a creating a controller that prepares pages for pagination based on the number of lines that are generated for each page (before sending them to the page for output) as described in Creating Professional PDF Documents with CSS.


3

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 hyperlink on the name references. This would reduce your visible output to the user considerably. For those, you can make use of std html a href tags, or use apex ...


3

apex:include resolves its reference before any other element on a page, early in the rendering process. This means that each apex:include will include only one page, and that reference must be non-null before any getters are called. This is different than most other elements, which are executed in page flow order. While this isn't documented, I did some ...


3

What you want to do typically requires a custom controller. There's an excellent tutorial in the Technical Library titled Creating Professional PDF Documents with CSS and Visualforce that describes exactly how how to do what you're asking about. It basically involves composing your pages in the controller by counting the lines before they're sent to the ...


3

The suggestion from How to deal with page breaks when printing a large HTML table seems applicable: Note: when using the page-break-after:always for the tag it will create a page break after the last bit of the table, creating an entirely blank page at the end every time! To fix this just change it to page-break-after:auto. It will break correctly and not ...


3

Your prog variable is actually a record, not an index. It represents co in your Apex parallel. <apex:repeat value="{!myMap[data][emp]}" var="co"> <apex:outputText value="{!co.Field__c}" /> </apex:repeat>


3

I had trouble making this work with pageBlockTable (or dataTable) but I could with apex:repeat Using this controller property with unimaginative accountNames: public map<Date,List<Account>> dateToAccountsMap { get {return new map<Date,List<Account>> { Date.newInstance(2020,1,1) => new List<Account> {new Account(...


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