You need to sign in to do that
Don't have an account?

Apex Repeat
Hello,
The example provided by Salesforce:
<!-- Page: --> <apex:page controller="repeatCon" id="thePage"> <apex:repeat value="{!strings}" var="string" id="theRepeat"> <apex:outputText value="{!string}" id="theValue"/><br/> </apex:repeat> </apex:page> /*** Controller: ***/ public class repeatCon { public String[] getStrings() { return new String[]{'ONE','TWO','THREE'}; } }
Displays
<span id="thePage:theRepeat:0:theValue">ONE</span><br/> <span id="thePage:theRepeat:1:theValue">TWO</span><br/> <span id="thePage:theRepeat:2:theValue">THREE</span><br/>
How can I code it in a way it'll show the following:
ONE
TWO
THREE
Instead of
<span id="thePage:theRepeat:0:theValue">ONE</span><br/>
I plan on doing an export on the VF page using contentType and will display the following
<salorder>
"sForce",,,"The Landmark @ One Market",,"San Francisco","CA","94087","US"
"1","00004757" ,"7-9-2012","7-9-2012","0.00","0.00"
"","1.0000","0.0000","0.00" Fieldworker Rate
</salorder>
I should be able to display the following above in the same format, spacing etc. The above would be considered one record so there will be multiple <salorder> </salorder> based off my data construction.
You can also you HTML <table> between <apex:repeat> and display the list the way you like.
I plan on doing an export on the VF page using contentType
I want it in a text file, so I don't think the HTML table will help. I just want to display the values .
<salorder>
"sForce",,,"The Landmark @ One Market",,"San Francisco","CA","94087","US"
"1","00004757" ,"7-9-2012","7-9-2012","0.00","0.00"
"","1.0000","0.0000","0.00" Fieldworker Rate
</salorder>
I should be able to display the following above in the same format, spacing etc. The above would be considered one record.
Try something like this:
Instead of 'One','Two','Three'.
Is it possible to insert a List?
You could always ditch the apex:repeat element and create your string in controller code:
Then in the VF page all you need to do is reference {!listAsCsv}.
Regards, jh