+ Start a Discussion
Ronak PatelRonak Patel 

List<String> of Controller in Javascript of visualforce page



Can anybody tell me that 


How i can use list variable value from controller in javascript without using apex:repeat in visualforce page.



I have one list<String> in controller with 1000 records.

i want that recoerds in javascript so i can't use apex:repeat because of (page view size limit)


Reply fast...

Andy BoettcherAndy Boettcher

Would Javascript Remoting to an APEX method help you parse through what you're trying to do?



var lst = '{!listofstringvalues}';



Ronak PatelRonak Patel

this is working when list have number.

i have used like this



var acccity=[<b><a name='001M0000009SCtQIAW' href='/001M0000009SCtQIAW' target='_blank'>Test Testing9</a></b><br/><b>Account Number: </b>09-TESTING<br/><b>Previous FY Sales: $ </b>0.00<br/><b>Current FY Sales: $ </b>0.00<br/><b>Price Level: </b>Not Identified<br/><b>Phone Number:</b>123456789<br/><b>Address:</b><br/>bapunagar<br/>Ahmedabad<br/>gujarat<br/>india<br/>, <b><a name='001M0000009BhimIAC' href='/001M0000009BhimIAC' target='_blank'>Test 123456</a></b><br/><b>Account Number: </b>12-SURYA1<br/><b>Previous FY Sales: $ </b>0.00<br/><b>Current FY Sales: $ </b>0.00<br/><b>Price Level: </b>V<br/><b>Phone Number:</b>12345<br/><b>Address:</b><br/>Rajkot<br/>Gujarat<br/>India<br/>];


this will give error...

try to find this...


r u constructing the components in the class it self or wat?

Ronak PatelRonak Patel


I am generating that String in Controller and then make in the html Format but when i am retriving that list<String> in javascript that will give error.


dude then this is not the list of values from the controller then,,,split the keywords and get the values

Aravind SriramAravind Sriram
try this..
<script type="text/javascript">
    var sampleVar = "{!lstStringvariable}";
    document.getElementById('sampleDiv').innerHTML =sampleVar;
<div id="sampleDiv"/>



Ronak PatelRonak Patel

This is not solution....

this will display all values in single String value

i have 50 records in one list