You need to sign in to do that
Don't have an account?
Dynamic table in vf page
Hi,
How to create tables dynamically in vf page? For example i have 2 objects having 2 pick list fields in two fields
values are same like group1,group2,group3.....
suppose i have 5 pick list values using vf page in 2 objects pick list values are same thar records
in same table in two rows like this
hghghfghf ghghfhgf fhffhh
fghfhf fhhfhf hghfhf hghfhffh hfhhf
but i have 5 pick list values so display records dynamically in tables horizontally. suppose i have only one grovp(picklist value) records only display only 1 table only
Any one can help?
Thank you
You can achive this using wapper class -
> create a list of wapper class then In a wapper class use list of object.
like -
public class ABC
{
public list<modelname> modellist {get;set;}
public class modelname
{
public list<object> objlist1{get;set;}
public list<object2> objlist2{get;set;}
}
}
VFPAGE
<apex:repeat value="{!modellist}" var="a">
<apex:repead value="{!a.objlist1} var="aa">
</apex:repeat>
</apex:repeat>
Thank you,
Please mark this as solution for others to get it easily
Hi Raj,
Thanks for your reply.
Am getting an error unexpected class modelname. Can you explain in brief.
Thank you
Hi Varun,
You didn't write the wrpper class that's why you are getting that error
see this link and understand the Wrapper Class.
http://wiki.developerforce.com/page/Wrapper_Class
http://shivasoft.in/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/
http://www.interactiveties.com/b_visualforce_wrapper_class.php
http://vck1.blogspot.in/2011/05/wrapper-class-in-apexvisual-force.html
Still have any problem please let me know