2 // This function takes the main pane widget and jams its widget in the right
5 function _asyncEchoHandler(result, ex, id, paneWidget) {
6 var replyTextArea = null;
7 var refreshButton = null;
8 var echoTextField = null;
11 // We need to remove anything previously drawn in this area.
12 paneWidget.removeAll();
14 echoTextField = new qx.ui.form.TextField();
15 echoTextField.setTop(0);
16 echoTextField.setLeft(0);
18 refreshButton = new qx.ui.form.Button("Refresh");
19 refreshButton.setTop(0);
20 refreshButton.setLeft(150);
23 qx.ui.form.TextArea(result);
24 replyTextArea.setWrap(true);
25 replyTextArea.setWidth("100%");
26 replyTextArea.setHeight("50%");
27 replyTextArea.setTop(30);
28 replyTextArea.setBottom(50);
29 replyTextArea.setLeft(0);
30 replyTextArea.setRight(20);
32 alert("Async(" + id + ") exception: " + ex);
34 paneWidget.add(replyTextArea);
35 paneWidget.add(refreshButton);
36 paneWidget.add(echoTextField);
38 // Provide a handler for the button.
39 with (refreshButton) {
40 addEventListener("execute", function(e) {
41 this.debug("executed: " + this.getLabel());
42 this.debug("echoTextField.getValue(): " + echoTextField.getValue());
43 _echoPlugInDisplay(paneWidget, echoTextField.getValue());
48 function _echoPlugInDisplay(paneWidget, echoText) {
49 if (echoText == null) {
50 echoText = "Hello World!";
53 var rpc = new qx.io.remote.Rpc();
54 rpc.setTimeout(60000);
55 rpc.setUrl("/services/");
56 rpc.setServiceName("samba.adm");
57 rpc.setCrossDomain(false);
59 mycall = rpc.callAsync(
60 function(result, ex, id) {
61 _asyncEchoHandler(result, ex, id, paneWidget);
67 function EchoPlugIn() {
69 o.display = _echoPlugInDisplay;