3
<title>The source code</title>
4
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7
<body onload="prettyPrint();">
8
<pre class="prettyprint lang-js">Ext.onReady(function(){
9
Ext.Direct.addProvider(
17
var out = new Ext.form.DisplayField({
22
var text = new Ext.form.TextField({
24
emptyText: 'Echo input'
27
var call = new Ext.Button({
30
TestAction.doEcho(text.getValue(), function(result, e){
31
var t = e.getTransaction();
32
out.append(String.format('<p><b>Successful call to {0}.{1} with response:</b><xmp>{2}</xmp></p>',
33
t.action, t.method, Ext.encode(result)));
34
out.el.scroll('b', 100000, true);
39
var num = new Ext.form.TextField({
41
emptyText: 'Multiply x 8',
42
style: 'text-align:left;'
45
var multiply = new Ext.Button({
48
TestAction.multiply(num.getValue(), function(result, e){
49
var t = e.getTransaction();
51
out.append(String.format('<p><b>Successful call to {0}.{1} with response:</b><xmp>{2}</xmp></p>',
52
t.action, t.method, Ext.encode(result)));
54
out.append(String.format('<p><b>Call to {0}.{1} failed with message:</b><xmp>{2}</xmp></p>',
55
t.action, t.method, e.message));
57
out.el.scroll('b', 100000, true);
62
text.on('specialkey', function(t, e){
63
if(e.getKey() == e.ENTER){
68
num.on('specialkey', function(t, e){
69
if(e.getKey() == e.ENTER){
74
var p = new Ext.Panel({
75
title: 'Remote Call Log',
82
bbar: [text, call, '-', num, multiply]
83
}).render(Ext.getBody());
85
Ext.Direct.on('message', function(e){
86
out.append(String.format('<p><i>{0}</i></p>', e.data));
87
out.el.scroll('b', 100000, true);
b'\\ No newline at end of file'