You need to sign in to do that
Don't have an account?
SurjenduK
The above code does a ajax request on a hyperlink click and dumps the output data. I want to build a <apex:dataTable> instead of just dumping the data. How do I achieve this?
A basic question " How to do complex ajax request within VisualForce". All the examples in the pdf and books are simple and does not reflect the actual complexity of the ajax problems we face. Any help from gurus? My earlier example has everything in HTML covered in just <apex:page>. The apex:page is the only tag i am using to make it a visualforce page.
I eventually want it to be a VF page and not SControl. So please dont give me suggestions to use S-Control.
How to do complex ajax request within VisualForce?
How to do complex ajax request within VisualForce?
Code:
<apex:page> <script src="/soap/ajax/12.0/connection.js" type="text/javascript"></script> <script> function setupPage(search) { var output = document.getElementById("output"); try { sforce.connection.login("surkuila@gmail.com", "pooja1234$lFX0WCCdn6h1ut6WoxWkwUB0c"); var queryResult = sforce.connection.query("Select Id, name from Lead where name like '%" + search + "%'"); layoutResults(queryResult, output); } catch(error) { queryFailed(error, output); } } function queryFailed(error, out) { out.innerHTML = "<font color=red>An error has occurred:</font> <p>" + error; } function layoutResults(queryResult, out) { if (queryResult.size > 0) { var output=""; var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var lead = records[i]; output += lead.Id + " " + lead.Name + "<BR>"; } out.innerHTML = output; } else { out.innerHTML = "No records matched."; } } </script> <div class="bNext"> <div class="withFilter"> <div class="rolodex"> <a href="javascript:setupPage('A')" class="listItem"><span class="listItemPad">A</span></a> <a href="javascript:setupPage('B')" class="listItem"><span class="listItemPad">B</span></a> </div> </div> </div> <body> <div id="output"></div> </body> </apex:page>
The above code does a ajax request on a hyperlink click and dumps the output data. I want to build a <apex:dataTable> instead of just dumping the data. How do I achieve this?
A basic question " How to do complex ajax request within VisualForce". All the examples in the pdf and books are simple and does not reflect the actual complexity of the ajax problems we face. Any help from gurus? My earlier example has everything in HTML covered in just <apex:page>. The apex:page is the only tag i am using to make it a visualforce page.
I eventually want it to be a VF page and not SControl. So please dont give me suggestions to use S-Control.
How to do complex ajax request within VisualForce?
consider this example
page:
and controller
when you click on the names in the list on the left, the box on the right redraws (partial page) using ajax , the tag the you add is
your example is just querying the database, and dumping a table, that is best done on the server in the controller, as shown above.
I have leads that have parent-child relationship with contacts.
I am trying to pull a list of leads where converted=False for example.
I will use this controller in the visualforce email template.
Thanks.