You need to sign in to do that
Don't have an account?
Qin Lu
Dynamically render sections based on types
I have a custom object A, it has a type field
if I have the following records in A
Name. Type
aaa. Checking
bbb. Checking
ccc. Investment
ddd. Saving
I want to build a page showing 3 sections
Checking
aaa
bbb
Investment
ccc
Saving
ddd
it is possible that the data doesn't contain Saving type of record, then I don't want Saving section showing up. It is possible that new types are added, for example, we have another Type Retirement added.
eee. Retirement
then I want to have another section rendered. Basically I can't hard code the name of the Type because it can change/expand, and I can't put fixed number of sections in page because it could change based on Tyes.
Is there any way to achieve this?
if I have the following records in A
Name. Type
aaa. Checking
bbb. Checking
ccc. Investment
ddd. Saving
I want to build a page showing 3 sections
Checking
aaa
bbb
Investment
ccc
Saving
ddd
it is possible that the data doesn't contain Saving type of record, then I don't want Saving section showing up. It is possible that new types are added, for example, we have another Type Retirement added.
eee. Retirement
then I want to have another section rendered. Basically I can't hard code the name of the Type because it can change/expand, and I can't put fixed number of sections in page because it could change based on Tyes.
Is there any way to achieve this?
Advantage of this is when ever you want to add a new type you just need add the related record to the custom setting object. No change in the code base/.
Some thing like this
and call the method from VF page some thing like this
This is just a sample that I used in my business scenario....
All Answers
The below post explains how you can hide a section based on the picklist value change
https://success.salesforce.com/answers?id=90630000000hTaaAAE
Yet another example https://developer.salesforce.com/forums/ForumsMain?id=906F000000097h9IAA
Hope this helps !
Advantage of this is when ever you want to add a new type you just need add the related record to the custom setting object. No change in the code base/.
Some thing like this
and call the method from VF page some thing like this
This is just a sample that I used in my business scenario....