8 Ext.onReady(function(){
10 function doEcho(field){
11 TestAction.doEcho(field.getValue(), function(result, event){
12 var transaction = event.getTransaction(),
13 content = Ext.String.format('<b>Successful call to {0}.{1} with response:</b><pre>{2}</pre>',
14 transaction.action, transaction.method, Ext.encode(result));
21 function doMultiply(field){
22 TestAction.multiply(field.getValue(), function(result, event){
23 var transaction = event.getTransaction(),
27 content = Ext.String.format('<b>Successful call to {0}.{1} with response:</b><pre>{2}</pre>',
28 transaction.action, transaction.method, Ext.encode(result));
30 content = Ext.String.format('<b>Call to {0}.{1} failed with message:</b><pre>{2}</pre>',
31 transaction.action, transaction.method, event.message);
38 function updateMain(content){
42 main.body.scroll('b', 100000, true);
45 Ext.direct.Manager.addProvider(Ext.app.REMOTING_API, {
49 data: function(provider, event){
50 updateMain('<i>' + event.data + '</i>');
55 var main = Ext.create('Ext.panel.Panel', {
57 title: 'Remote Call Log',
58 renderTo: document.body,
62 tplWriteMode: 'append',
64 bodyStyle: 'padding: 5px;',
73 emptyText: 'Echo input',
75 specialkey: function(field, event){
76 if (event.getKey() === event.ENTER) {
85 doEcho(main.down('#echoText'));
89 itemId: 'multiplyText',
92 emptyText: 'Multiply x 8',
94 specialkey: function(field, event){
95 if (event.getKey() === event.ENTER) {
104 doMultiply(main.down('#multiplyText'));