+ Start a Discussion

Values returned from a List should be displayed one per output textbox



I am new to salesforce.  Please can anyone help me in following issue.


My VF page Reads a CSV file and displays its field names on clicking command button


 <apex:inputFile value="{!contentFile}" filename="{!nameFile}" />

 <apex:commandButton action="{!ReadFile}" value="Next" id="theButton">



public string nameFile{get;set;}
 public Blob contentFile{get;set;}
 String[] filelines = new String[]{};
 String[] HeaderXLS = new String[]{};

 public Pagereference ReadFile()

        filelines = nameFile.split('\n');
        for (Integer i=1;i<filelines.size();i++)
            String[] inputvalues = new String[]{};
            inputvalues = filelines[i].split(',');
             HeaderXLS = filelines[0].split(',');
               length = HeaderXLS.size();
               for(Integer j=0;j<HeaderXLS.size();j++)
 PageReference page2 = new PageReference('/apex/Mapping'); <!-- Mapping is the page on which field names are displayed -->
      return page2;


 It displays all the field names in a single row.   i want it to display one field name per row.


Mapping page:

<apex:repeat value="{!list}" rows="{!Number}" var="c">
 <apex:outputText value=" {0} ">
       <apex:param value="{!Header}"/>

 Number of Rows are equal to the number of Fields


Best Answer chosen by Admin (Salesforce Developers) 

Well,  the solution is :

 <apex:param value="{!Header[c]}"/>