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. struts2框架 初始别

    struts2 是webwork和struts合并而来. 1.下载struts2 说明: Full Distribution: 为完整版下载,建议下载它 Example Applications:st ...

  2. Appium 客户端库 API

    ## Appium 客户端库 Appium 有对应以下语言的客户端库: 语言 | 代码 :--|--:[Ruby][rubygems] | [GitHub](https://github.com/ap ...

  3. strcpy vs memcpy

    [本文连接] http://www.cnblogs.com/hellogiser/p/strcpy_vs_memcpy.html [分析] strcpy和memcpy都是标准C库函数,它们有下面的特点 ...

  4. python virtualenv环境运行django

    python virtualenv环境运行django 安装前准备 检查pip版本与python版本是否一致 [root@localhost bin]# whereis pip pip: /usr/b ...

  5. cxGrid的使用方法

    来源 http://www.cnblogs.com/djcsch2001/archive/2010/07/19/1780573.html   1.  去掉GroupBy栏 cxGrid1DBTable ...

  6. BestCoder8 1001.Summary(hdu 4989) 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4989 题目意思:给出 n 个数,然后将这些数两两相加,得到 n*(n-1) /2 对和,把重复的和去掉 ...

  7. SQL Server order by语句学习回顾

    主要学习: 1.以指定的次序返回查询结果 2.按多个字段排序 3.按字串排序 4.处理排序空值 5.根据数据项的键排序 具体实例1---以指定的次序返回查询结果 n使用ORDER BY子句可以对结果集 ...

  8. 从键盘输入成绩,找出最高分,并输出学生成绩等级。成绩>=最高分-10,为A,成绩>=最高分-20,为B,成绩>=最高分-30,为C,其余等级为D

    import java.util.Scanner;public class TestStudent { public static void main(String[] args) { //从键盘获得 ...

  9. redis 常用命令

    查看redis信息和状态: > info redis下,数据库是由一个整数索引标识,而不是由一个数据库名称.默认情况下,一个客户端连接到数据库0.redis配置文件中下面的参数来控制数据库总数: ...

  10. Clr Via C#读书笔记---垃圾回收机制

    #1 垃圾回收平台的基本工作原理: 访问一个资源所需的具体步骤: 1)调用IL指令newobj,为代表资源的类型分配内存.在C#中使用new操作符,编译器就会自动生成该指令.2)初始化内存,设置资源的 ...