3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
7 Ext.onReady(function(){
8 Ext.Direct.addProvider(
16 var out = new Ext.form.DisplayField({
21 var text = new Ext.form.TextField({
23 emptyText: 'Echo input'
26 var call = new Ext.Button({
29 TestAction.doEcho(text.getValue(), function(result, e){
30 var t = e.getTransaction();
31 out.append(String.format('<p><b>Successful call to {0}.{1} with response:</b><xmp>{2}</xmp></p>',
32 t.action, t.method, Ext.encode(result)));
33 out.el.scroll('b', 100000, true);
38 var num = new Ext.form.TextField({
40 emptyText: 'Multiply x 8',
41 style: 'text-align:left;'
44 var multiply = new Ext.Button({
47 TestAction.multiply(num.getValue(), function(result, e){
48 var t = e.getTransaction();
50 out.append(String.format('<p><b>Successful call to {0}.{1} with response:</b><xmp>{2}</xmp></p>',
51 t.action, t.method, Ext.encode(result)));
53 out.append(String.format('<p><b>Call to {0}.{1} failed with message:</b><xmp>{2}</xmp></p>',
54 t.action, t.method, e.message));
56 out.el.scroll('b', 100000, true);
61 text.on('specialkey', function(t, e){
62 if(e.getKey() == e.ENTER){
67 num.on('specialkey', function(t, e){
68 if(e.getKey() == e.ENTER){
73 var p = new Ext.Panel({
74 title: 'Remote Call Log',
81 bbar: [text, call, '-', num, multiply]
82 }).render(Ext.getBody());
84 Ext.Direct.on('message', function(e){
85 out.append(String.format('<p><i>{0}</i></p>', e.data));
86 out.el.scroll('b', 100000, true);