Just use Ajax pattern to call object data from server on visualforce page.

Following is the Asynchronise demo:

<apex:page >
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script> <script src="../../soap/ajax/29.0/connection.js" type="text/javascript"></script> <script type="text/javascript">
window.onload = setupPage;
function setupPage(){
var state = {
output : document.getElementById("output"),
startTime : new Date().getTime()
}; var callBack = {
onSuccess : layoutResults,
onFailure : queryFailed,
source : state
}; sforce.connection.query("Select Id, Name, Industry From Account order by Industry", callBack);
} function queryFailed(error, source){
source.output.innerHTML="An error has occurred: " + error;
} function layoutResults(queryResult, source){
if(queryResult.size > 0){
var output = "";
var records = queryResult.getArray('records');
for(var i = 0; i < records.length; i++){
var account = records[i];
output += account.Id + " " + account.Name + " [Industry - " + account.Industry + "]<br>";
}
source.output.innerHTML = output;
}
} </script> <div id="output"></div> </apex:page>

If we want to use the Synchronise model. Just use the query function without callback.  Following is the demo code.

sforce.connection.query("Select Id, Name, Industry From Account order by Industry")

If you want to know more about the detail. Please go to click this link:  http://www.salesforce.com/us/developer/docs/ajax/apex_ajax.pdf

...................................

Another link show you another ajax call code-behind function : http://www.cnblogs.com/mingmingruyuedlut/p/3450753.html

How to use Ajax on Visualforce page on Salesforce platform的更多相关文章

  1. Salesforce学习之路-developer篇(三)利用Visualforce Page实现页面的动态刷新案例学习

    Visualforce是一个Web开发框架,允许开发人员构建可以在Lightning平台上本地托管的自定义用户界面.其框架包含:前端的界面设计,使用的类似于HTML的标记语言:以及后端的控制器,使用类 ...

  2. Salesforce学习之路(六)利用Visualforce Page实现页面的动态刷新功能

    Visualforce是一个Web开发框架,允许开发人员构建可以在Lightning平台上本地托管的自定义用户界面.其框架包含:前端的界面设计,使用的类似于HTML的标记语言:以及后端的控制器,使用类 ...

  3. 在Salesforce中向Page Layout中添加Visualforce Page

    在Salesforce中可以向Object所对应的Layout中添加我们自定义的Visualforce Page. 此时的Visualforce Page与Asp.Net MVC中的Partial V ...

  4. Salesforce随笔: 将Visualforce Page渲染为PDF文件(Render a Visualforce Page as a PDF File)

    参照 : Visualforce Developer Guide 第60页 <Render a Visualforce Page as a PDF File> 你可以用PDF渲染服务生成一 ...

  5. Visualforce Page CSS样式

    Salesforce Page开发者文档:https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_stylin ...

  6. Visualforce Page超链接

    Salesforce开发者文档:https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start ...

  7. 在Visualforce page中用自带的控件实现Ajax回调后台方法(并且可以用js去动态给parameters赋值)

    这里用的组合是:apex:commandLink  + apex:actionFunction + apex:outputPanel 这里的 apex:commandLink 和 apex:actio ...

  8. Salesforce随笔: 将Visualforce Page导出为 Excel/CSV/txt (Display a page in Excel)

    想要实现如题所述功能,可以参照 : Visualforce Developer Guide 第57页中所举的例子,在<apex:page>标签中添加contentType属性. <a ...

  9. Ajax load html page

    jQuery ajax - load() 方法 jQuery Ajax 参考手册 实例 使用 AJAX 请求来改变 div 元素的文本: $("button").click(fun ...

随机推荐

  1. js 的 深拷贝 和 浅拷贝

    http://www.cnblogs.com/yichengbo/archive/2014/07/10/3835882.html 类似于拷贝指针和 值?  ...占坑先.

  2. 77 找出最大连续自然数个数[Longest Consecutive Sequence in an Unsorted Array]

    [本文链接] http://www.cnblogs.com/hellogiser/p/Longest-Consecutive-Sequence-in-an-Unsorted-Array.html [题 ...

  3. poj1155

    题意:给定一个树形图,节点数量3000.叶子节点是用户,每个用户如果能看上电视会交一定的电视费.看上电视的条件是从根到该用户的路径全部被修好,修每条边有一个费用.在不亏损(用户交钱总额>=修路总 ...

  4. ios oc 和 swfit 用dispatch_once 创建单例

    网上已经有方法了,我这里就是抄了下,原文链接 http://bj007.blog.51cto.com/1701577/649413 http://blog.csdn.net/u010124617/ar ...

  5. FASTREPORT 整理 (mtm)

    DELPHI中用FASTREPORT制作报表  1.加载并存储报表 默认情况下,报表窗体同项目窗体构存储在同一个DFM文件中.多数情况下,无须再操作,因而你就不必采用特殊方法加载报表. 如果你决定在文 ...

  6. gcc-5.4.0 static dwarf2 compile

    ------------------------------------------------------------------------------- 又开始折腾了, 静态编译 gcc-5.4 ...

  7. Win8环境WPF打开和关闭软键盘

    代码如下: public class KeyBoardHelper { #region 键盘控制 /// <summary> /// 显示键盘 /// </summary> p ...

  8. python2.x和3.x的区别

    这个星期开始学习Python了,因为看的书都是基于 Python2.x,而且我安装的是Python3.1,所以书上写的地方好多都不适用于Python3.1,特意在Google上search了一下 3. ...

  9. 【leetcode】Remove Linked List Elements(easy)

    Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --& ...

  10. 原始套接字SOCK_RAW

    原始套接字SOCK_RAW 实际上,我们常用的网络编程都是在应用层的报文的收发操作,也就是大多数程序员接触到的流式套接字(SOCK_STREAM)和数据包式套接字(SOCK_DGRAM).而这些数据包 ...