/* ************************************************************************ Copyright: License: Authors: ************************************************************************ */ /* ************************************************************************ #asset(hello_world/*) ************************************************************************ */ /** * This is the main application class of your custom application "hello_world" */ qx.Class.define("hello_world.Application", { extend : qx.application.Standalone, /* ***************************************************************************** MEMBERS ***************************************************************************** */ members : { /** * This method contains the initial application code and gets called * during startup of the application * * @lint ignoreDeprecated(alert) */ main : function() { // Call super class this.base(arguments); // Enable logging in debug variant if (qx.core.Variant.isSet("qx.debug", "on")) { // support native logging capabilities, e.g. Firebug for Firefox qx.log.appender.Native; // support additional cross-browser console. Press F7 to toggle visibility qx.log.appender.Console; } /* ------------------------------------------------------------------------- Below is your actual application code... ------------------------------------------------------------------------- */ // Document is the application root var doc = this.getRoot(); var helloLabel = new qx.ui.basic.Label(""); doc.add(helloLabel, {left: 100, top: 50}); var echoEdit = new qx.ui.form.TextField(); doc.add(echoEdit, {left: 100, top: 100, right: 300}); var echoButton = new new qx.ui.form.Button("Echo"); doc.add(echoButton, {left: 320, top: 100}); var rpc = new qx.io.remote.Rpc("http://localhost:8080/", "com.pengutronix.jdb.Hello|/"); rpc.callAsync(function(result, error) { if (error == null) { helloLabel.setText(result); } else { helloLabel.setText("Error: " + error); } }, "com.pengutronix.jdb.Hello.HelloWorld"); // Add an event listener echoButton.addListener("execute", function(e) { rpc.callAsync(function(result, error) { if (error == null) { echoLabel.setText(result); } else { echoLabel.setText("Error: " + error); } }, "com.pengutronix.jdb.Hello.Echo", echoEdit.getValue()); }); } } });