3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
18 'Ext.form.field.Text',
19 'Ext.toolbar.TextItem'
22 Ext.onReady(function(){
24 function doEcho(field){
25 TestAction.doEcho(field.getValue(), function(result, event){
26 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));
35 function doMultiply(field){
36 TestAction.multiply(field.getValue(), function(result, event){
37 var transaction = event.getTransaction(),
41 content = Ext.String.format('<b>Successful call to {0}.{1} with response:</b><pre>{2}</pre>',
42 transaction.action, transaction.method, Ext.encode(result));
44 content = Ext.String.format('<b>Call to {0}.{1} failed with message:</b><pre>{2}</pre>',
45 transaction.action, transaction.method, event.message);
52 function updateMain(content){
56 main.body.scroll('b', 100000, true);
59 Ext.direct.Manager.addProvider(Ext.app.REMOTING_API, {
63 data: function(provider, event){
64 updateMain('<i>' + event.data + '</i>');
69 var main = Ext.create('Ext.panel.Panel', {
71 title: 'Remote Call Log',
72 renderTo: document.body,
76 tplWriteMode: 'append',
78 bodyStyle: 'padding: 5px;',
87 emptyText: 'Echo input',
89 specialkey: function(field, event){
90 if (event.getKey() === event.ENTER) {
99 doEcho(main.down('#echoText'));
103 itemId: 'multiplyText',
106 emptyText: 'Multiply x 8',
108 specialkey: function(field, event){
109 if (event.getKey() === event.ENTER) {
118 doMultiply(main.down('#multiplyText'));