You need to sign in to do that
Don't have an account?
Peace
Display different default value in different list boxes
Hi,
I am new to Salesforce, I have a query, Please look into following scenario:
I made a VF page containing 'n' number of listboxes.
Each list box shows all the field names from a CSV file, and the first field name remains the default selected value for each list box (ie. All the list boxes are having same default value)
Number of list boxes are equal to number of fields in CSV file.
I want each list box to have a different field name as default selected value
Can anyone please help ?
Hi Peace,
Can you please share your VF code and a sample csv you are using for reference and describe what you want to achieve.
Regards
Hi,
Following VF page (UploadCSV )is used for browsing and uploading any CSV file
Select Object to import CSV Data
<apex:selectList required="true" multiselect="false" size="1" label="Type" value="{!selectedValue}">
<apex:selectOptions value="{!Items}"/>
</apex:selectList>
<br/>
Select CSV file
<apex:inputFile value="{!contentFile}" filename="{!nameFile}" /> <br/>
<apex:commandButton action="{!ReadFile}" value="Next" id="theButton" style="width:70px;"/>
Following is the VF page (Mapping) showing N number of Listboxes .
Number of list boxes on the left are equal to the number of fields (columns) in the CSV file uploaded.
<apex:repeat value="{!list}" rows="{!Number}" var="c">
<apex:selectList multiselect="false" size="1" style="width:200px;" value="{!selectedValue1[c]}">
<apex:selectOptions value="{!Header}"/>
</apex:selectList>
<apex:selectList multiselect="false" size="1" style="width:300px;" value="{!selectedValue2[c]}" >
<apex:selectOptions value="{!FieldList}"/>
</apex:selectList>
<br/>
</apex:repeat>
<br/>
<apex:commandButton action="{!Savetoobj}" value="Save to Object" id="theBtn23" style="width:100px;"/>
you can take any CSV file ( for eg download and use the CSV file provided at http://support.vendhq.com/entries/21265746-Sample-CSV-file-to-upload-into-trial-account. Just keep only 5 columns and delete the rest for simplicity)
Controller: