function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ronak PatelRonak Patel 

List<String> of Controller in Javascript of visualforce page

Hello,

 

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?

kiranmutturukiranmutturu

<script>

var lst = '{!listofstringvalues}';

 

</script>

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...

kiranmutturukiranmutturu

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

Ronak PatelRonak Patel

Yes,

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.

kiranmutturukiranmutturu

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;
</script>
<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