jsni

Google Wallet Integration through custom widget in Vaadin6

情到浓时终转凉″ 提交于 2020-01-06 15:32:23
问题 I need to integrate Google wallet into my Vaadin 6 application, downloaded wallet api/demo from here. First I was trying to run this given sample into vaadin but after a long effort I am stuck now. Tried lots of ways/examples , studied lot about widgets but only this example was found to be simple and working. I added my lines of code, the process going smooth upto the purchase() call but when it calls wallet API function buy() the browser's page get cleared and nothing happened as if program

Google Wallet Integration through custom widget in Vaadin6

核能气质少年 提交于 2020-01-06 15:32:13
问题 I need to integrate Google wallet into my Vaadin 6 application, downloaded wallet api/demo from here. First I was trying to run this given sample into vaadin but after a long effort I am stuck now. Tried lots of ways/examples , studied lot about widgets but only this example was found to be simple and working. I added my lines of code, the process going smooth upto the purchase() call but when it calls wallet API function buy() the browser's page get cleared and nothing happened as if program

GWT JSNI javascript to Java not working

不羁的心 提交于 2019-12-30 10:59:18
问题 I am trying to invoke a Java Method from my Javascript code. This is for a Windows Phone 7 app using Phonegap. I have the following in my javascript code. document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown(){ } And in my Java code I have the following. public static native void exportStaticMethod() /*-{ $wnd.onBackKeyDown = $entry(this.@com.mycompany.myapp.client.MyApp::hideSettingsWidgets()); }-*/; Then in the on onModuleLoad() I am calling it like so:

Issue with calling instance method from handwritten javascript

偶尔善良 提交于 2019-12-25 04:15:19
问题 Can anyone help with what is wrong in the code below(based on the answers to a similar question asked on SO): public String javaMethod(String input) { return "it works"; } public native void defineBridgeMethod() /*-{ var that = this; $wnd.jsFunction= $entry(function(msg) { that.@com.myclass.ClassName::javaMethod(Ljava/lang/String;)(msg) }); }-*/; The issue is that Javascript does not find jsFunction: alert(jsFunction) in Javascript code returns 'undefined'. Thanks. Edit: Huh, one hour later:

JSNI (GWT-GWTP): jQuery does not select node in 'document ready' function after ready event fires

落爺英雄遲暮 提交于 2019-12-24 18:54:27
问题 I am trying to select a div node based on its CSS ID, and change the div's text, all with jQuery (2.2.0). My problem is that jQuery selection never seems to happen normally? That jQuery selection code (below, where I'm using the '$' shorthand for 'jquery' fucntion) is within a standard 'document ready' callback function so that the div with CSS ID is "supposedly" ensured to be in the DOM by the time the callback is called. That js code, and its standard JSNI $wnd syntax, resemble the Answers

GWT and JSNI add Javascript button into HTML panel

只谈情不闲聊 提交于 2019-12-24 04:01:28
问题 I create a simple Javascript file containing a simple button. function testfuncion() { document.write('<input type="button" name="hello" value="hello">'); } Then I created a HTML panel in gwt. HTML panelHtmlTry = new HTML(); How can put the Javascript button into the HTML panel? In this experiment I can't create the button in gwt but only put a Javascript object into the gwt panel. PS: i can use html panel or horizzontal panel. My objective is put a javascript button on each GWT panel and

GWT: How to share a java Object (ie: EventBus) between two modules

喜夏-厌秋 提交于 2019-12-23 05:27:34
问题 I’m building a large application and I would like to split it in several modules like Core Module for initialization, users management, etc…, Customer Module, Production Module, etc… I want to split it in multiples GWT modules (not using GWT splitting technique) and share an EventBus for broadcast some events like LoginEvent, LogoutEvent. I don’t want uses the code splitting technique because I want reduce the compile time and re-compile only the module that I modified. This allow also to

Adding a div element inside a panel?

陌路散爱 提交于 2019-12-23 03:51:45
问题 I'm working with GWT and I'm trying to add google-maps to my website. Since I want to use google-maps V3 I'm using JSNI. In order to display the map in my website I need to create a div element with id="map" and get it in the initialization function of the map. I did so, and it worked out fine but its location on the webpage is funny and I want it to be attached to a panel I'm creating in my code. So my question is how can I do it? Can I create a div somehow with GWT inside a panel ? I've

Which is the difference between $doc.getElementById(“id”) and document.getElementById(“id”) in JSNI

笑着哭i 提交于 2019-12-22 04:42:48
问题 I'm working in a native function inside a GWT application and I've tried this two methods: document.getElementById("id") returns null but $doc.getElementById() returns a valid element. Which is the difference (conceptually) between this methods? Thanks in advance. 回答1: The code of your GWT app runs in a (hidden) iframe, so document references that iframe's document (and window the iframe's browsing context). GWT thus initializes the variables $doc and $wnd to let you easily reference the

Pass Java Callback Function to JSNI Method?

怎甘沉沦 提交于 2019-12-21 21:15:53
问题 I want to pass a success and a failure callback Java function to a JSNI method. This is what I get so far but it does not work. How can I fix it? package c; public class A { test(new Callback<String, String>() { @Override public void onFailure(String reason) { Window.alert("fail"); } @Override public void onSuccess(String result) { Window.alert("suc"); } }); native void test(Callback<String, String> callback) /*-{ var callback = $entry(function(event) { callback.@c.A.Callback::onSuccess(Ljava