You need to sign in to do that
Don't have an account?
Dennis Graves
Check if related list is empty on visualforce page
I have an object model that has a related list, and on a Visualforce page I am displaying a fully custom UI for this related list.
The issue is that I need to only display a section if the related list has records, but due to the styling there is a div that is outside the repeater that needs to be hidden if the related list is empty.
I attempted using the .size(), ISNULL, ISEMPTY on the visualforce page, but those don't work, either they throw an error or don't return the expected results.
Is there a way to determine if a related list is populated without using a custom apex extension or including a rollup field that counts the number of related objects?
The issue is that I need to only display a section if the related list has records, but due to the styling there is a div that is outside the repeater that needs to be hidden if the related list is empty.
I attempted using the .size(), ISNULL, ISEMPTY on the visualforce page, but those don't work, either they throw an error or don't return the expected results.
Is there a way to determine if a related list is populated without using a custom apex extension or including a rollup field that counts the number of related objects?
We had come across the same requirement in one of the project to show realated list on custom page with related list linklets at the top as we have in standard page.
It would be great if you can share some sample code for it.
Thanks !!
<apex:pageBlockTable ... rendered="{!contacts.size!=0}">
Actually, I agree with James. Using ">" or "<" symblols is not good in HTML page (or visualforce)
So, you have 3 possible option =)