+ Start a Discussion
ashish jadhav 9ashish jadhav 9 

How can I create a vf page like on side bar I've a label called expand and with + symbol and when I click on that list of 3 option will appear and + sign changed to -?

basically I want simple option to be displayed on sidebar as 'Expand' with '+' sign and when I click on that it will display 3 more options(lets say
1. A,
2. B &
3. C with '-' sign.
so when I click on lets say 1.A then it must display A objects field. so how can I achieve this functionality? What should be my controller should have? 
I think that we need to use wrapper class, but need your suggestion, please help.
veda shriveda shri
Hi Ashish,

If it is only a matter of object and its related fields you can us below approach.

1. In controller create a map<String, list<string>> which will have map<ObjectName, List<Related fields>>. and you can use this map in page.
2. Second approach is crateing wrapper class.
Class objAndFieldWrapper
  String strObjName{get;set;}
  List<String> lstFields {get;set;}