You need to sign in to do that
Don't have an account?
Arek S.
What kind of object does DataTable work with?
I'm creating a DataTable but I will be feeding it data from a created object in my controller but I will not be using the SELECT SQL command. What kind of object do I have to create in my controller to work with the DataTable? I'm assuming it's going to be a List, but a list of what? A list of class objects with just variables?
Thanks.
P.S. I'm quite new to Visualforce ... hence this question.
You need to define the classLOData so that the data members either have getter/setter methods or are definedusing the apex property syntax . Just public members doesn't work.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_properties.htm#kanchor354
All Answers
I think it has to be a collection, but doesn't have to be a list.
Here is info about a list:
"A list is an ordered collection of typed primitives, sObjects, user-defined objects, Apex objects or collections that are distinguished by their indices."
See documentation here.
Thanks, I know what a List is, but the question I have is a List containing what kind of objects will work with the DataTable on a Visualforce page. Hope that clarifies things a little.
Thanks.
Any colletion (List, Map, Set) should work with data table. List can be (but are not limited to):
primitives (think int, string, etc)
sObjects (any standard or custom object in the database)
Apex objects (object you make from a custom class)
Does this make sense?
The list can contain any kind of objects with fields to use for the columns. Sobjects, or Apex objects. Apex class can use get/set property definitions or it can define getter/setter methods.
I'm thinking there must be something I'm missing cause I'm new to Visualforce, so I think some code examples will be best ...
Here's what my Visualforce page code looks like:
And here's what my controller looks like:
Unfortunately with the above code I get a "unknown property" error.
What do I need to change in this code to make it work?
Thank you for all the help.
You need to define the classLOData so that the data members either have getter/setter methods or are definedusing the apex property syntax . Just public members doesn't work.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_properties.htm#kanchor354