diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-06-14 21:18:49 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-06-14 21:18:49 +0300 |
commit | 72c0f66e2aa588acbb517e6d9b482c7a75faf9f1 (patch) | |
tree | 52f6a4f9febfe344d5fcb7e5a3eeb18934d0f427 /WebContent | |
parent | 755adc2731383e6e04ddfa5bee04b6ed6feaf243 (diff) | |
download | vaadin-framework-72c0f66e2aa588acbb517e6d9b482c7a75faf9f1.tar.gz vaadin-framework-72c0f66e2aa588acbb517e6d9b482c7a75faf9f1.zip |
Use callbacks directly as fields in connector object (#8888)
Diffstat (limited to 'WebContent')
-rw-r--r-- | WebContent/statictestfiles/jsconnector.js | 1 | ||||
-rw-r--r-- | WebContent/statictestfiles/jsextension.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/WebContent/statictestfiles/jsconnector.js b/WebContent/statictestfiles/jsconnector.js index 1432c20698..e08c748aa6 100644 --- a/WebContent/statictestfiles/jsconnector.js +++ b/WebContent/statictestfiles/jsconnector.js @@ -5,6 +5,7 @@ window.com_vaadin_tests_components_javascriptcomponent_BasicJavaScriptComponent_ rootElement.innerHTML = 'Hello world!'; rootElement.onclick = function() { connector.getRpcProxyFunction("com.vaadin.tests.components.javascriptcomponent.BasicJavaScriptComponent$ExampleClickRpc", "onClick")("message"); + connector.onclick("another message"); } connector.onStateChange = function() { console.log('state change:', this.getState()); diff --git a/WebContent/statictestfiles/jsextension.js b/WebContent/statictestfiles/jsextension.js index be551746ca..d824218560 100644 --- a/WebContent/statictestfiles/jsextension.js +++ b/WebContent/statictestfiles/jsextension.js @@ -1,4 +1,5 @@ window.com_vaadin_tests_extensions_SimpleJavaScriptExtensionTest_SimpleJavascriptExtension = function() { + var self = this; var state = this.getState(); var greetBack = this.getRpcProxyFunction('com.vaadin.tests.extensions.SimpleJavaScriptExtensionTest$SimpleJavaScriptExtensionServerRpc', 'greet'); @@ -10,4 +11,11 @@ window.com_vaadin_tests_extensions_SimpleJavaScriptExtensionTest_SimpleJavascrip } } }); + + this.greetToClient = function(greeting) { + var response = window.prompt(state.prefix + greeting); + if (response !== null) { + self.greetToServer(response); + } + } }
\ No newline at end of file |