I want to read in a CSV file and display the data as a table in a VF page. So for example my file might look like this:
Name, category, description, Priority, Type, Status, Number,
Issue11, Decision Required, Bad data, High, System, txt,100,
Issue15, Decision Required, Some data, Low, System, tyxt,200,
Issue13, Decision Required, Some data, Low, System, texta,300,
After the text is displayed the user will be able to insert into an object but initially i just want to display the file values (7 columns, 3 data rows) before any object associations are made. The problem i am having is how do i reference the separate column names in the VF page so each value display in a column.
If i were association with an object (eg Account) i could use for example the code:
<apex:column value="{!val.name}" />
to display the 1st column
But how do i reference the value when the data is just from the file itself.
I've tried list of list, a list of maps but i can't get this to work.
The code i am using is of this form:
<apex:repeat value="{!alist}" var="l">
<apex:dataList value="{!l}" var="c">
{!c}
</apex:dataList>
</apex:repeat>
So an example i have tried is this
<apex:repeat value="{!myList}" var="myMap">
<apex:pageblocktable value="{!myMap}" var="c">
<apex:column value="{!c.name}" />
<apex:column value="{!c.category}" />
</apex:pageblocktable>
</apex:repeat>
This does not work though. What does the variable c have to be so i can reference the distinct values?
Any help will be appreciated.