You need to sign in to do that
Don't have an account?
Displaying related objects fields in a free form instead of columns
I have a custom object with a lookup to Opportunity, so I can display the custom object's records in the related list section of opportunity. I'm trying to display the fields of this custom object record in a free form on the opportunity page (just like any other fields of opportunity) as opposed to the columns which seem to be the default for dataTable or pageBlockTable.
To illustrate the problem, this is how its currently displayed-
Opportunity page:
.... some opportunity fields here...
Related list- Custom object
field1 field2 field3 field4
----------------------------------------
value1 value2 value3 value4
valueA valueB valueC valueD
I want to display the custom object records (one block for every record) like this-
field1: value1
field2: value2
field3: value3
field4: value4
field1: valueA
field2: valueB
field3: valueC
field4: valueD
Any suggestions? Thanks in advance.
Thanks for the quick response. With apex:repeat, is there a way to use some conditionals? For example, I want to filter out some records from the display based on certain condition. Is that possible?
Thanks again.
I think the smartest way to do it is filter it out in an Apex class. So value="{!records}" where getRecords only returns the list of records you want to display.
Technically you could surround everything inside the repeat with an outputPanel and set the rendered attribute of your outputPanel to some condition, but I would recommend the first option. It would probably be more efficient anyway.