You need to sign in to do that
Don't have an account?
Satish Prajapat
Display List on VF page from apex class
- I have class A and I want to display List<A> on VF Page.
-
// Class A public with sharing class A { public String p; public String q; public String r; public String s; public String t; } // My Apex Code public class MyApexClass { public void m1() { StaticResource sr = [select id,body from StaticResource Where Name = 'MyFile']; String contents = sr.body.toString(); List<A> list_obj = new List<A>(); for(String line : contents.split('\n')) { String[] myArray= line.split('#'); A a = new A(); a.p = myArray[0]; a.q = myArray[1]; a.r = myArray[2]; a.s = myArray[3]; a.t = myArray[4]; list_obj.add(a) ; } } }
For more info. on apex repeat - https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm (https://developer.salesforce.com/forums/?id=906F0000000BSriIAG)
https://developer.salesforce.com/forums/?id=906F0000000BSriIAG
All Answers
Hello Prithviraj,
What is the benefit if I use this inside the class.
Still my doubt is present that how to display List on VF Page.
For more info. on apex repeat - https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm (https://developer.salesforce.com/forums/?id=906F0000000BSriIAG)
https://developer.salesforce.com/forums/?id=906F0000000BSriIAG