JSNI window document $wnd $doc

GWT JSNI Variables – An Exhaustive List  FROM HERE   $wnd Reference to the root browser window GWT widgets are being rendered to. Note that when called from the iframe linker, GWT code runs in an iframe, not the root browser window, so calling window will reference the wrong window. $doc Same as above, but referencing the…

speed up gwt compilation

1. use ” <draftCompile>true</draftCompile> ” in the gwt-maven-plugin configuration. 2. use another build profile to limit permutation: HERE is the detail . To set gwt up, use : mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.1 -DgroupId=com.goodtrendltd.gwt -DartifactId=MyDemo -Dversion=1.0-SNAPSHOT

gwt table td tr getOffsetHeight() inconsistency if border is set

In Gxt3 grid’s column header, if you set any border to the header row, your column header will grow. Also if you have filter in the header, even just hovering on the filter will cause the growth. After digging into the code, the following code in ColumnHeader causes this: (my current version is 3.0.6) This…

event loop gwt scheduleDeferred

A browser event loop is a thread started by the browser that is constantly scanning for and running different events, just like it sounds. As events occur they are put in the event queue and run in turn by the one event thread. Your javascript should not create its own loops waiting for it to…

Debug GWT application in a remote browser(virtualbox)

In eclipse open your debug configuration and add the param -bindAddress YourIPOrDomain(replace the ip with the local ip address of your machine) to the arguments > program arguments. That’s how we debug in virtual box. In Intellij, just add the above param into the GWT Configruation’s Dev Mode parameters.

gwt Widget AcceptsOneWidget Composite IsWidget SimplePanel

Let’s first separate interfaces from classes. Interfaces are great for mocking (thus allowing for testing your app without the need for the sluggishGWTTestCase): IsWidget: when all you need is a handle on a widget, without depending on the Widget class. This is typically used with MVP as a way to represent the view. AcceptsOneWidget: when you need a placeholder for…

scheduler and timer in gwt

Comparison Use Scheduler when you need a browser to complete whatever it is currently doing before you tell it to do something else. For example: myDialogBox.show(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { myTextBox.setFocus(); } }); In this example, focus will not be set until the browser completes rendering of the dialog, so you tell the…

Be careful of discrepancy between the GWT development mode and production mode

We spend most of our development time running our application in development mode, which means that we are interacting with our GWT application without it having been translated into JavaScript. Anytime we edit, run, and debug applications from a Java integrated development environment (IDE), we are working in development mode. When an application is running in…

Emulate JRE class in GWT

In our recent code search, we found that some GWT client code is used  in one of the classes in GWT shared package. The GWT client classes used are “com.google.gwt.i18n.client.NumberFormat” and “com.google.gwt.i18n.client.DateTimeFormat“. This would cause problem if the class is used in server side since there is no GWT client dependency in server side. On the…

gwt linkers

Perhaps you want only a single script output or you want to use the application in a cross-site manner (in a different URL). In those and other cases, you can use GWT’s linkers to help. GWT’s compilation is in two parts: Java to JavaScript and then linking and packaging. The default linker is the com.google.gwt.core.linker.IFrameLinker and is responsible for…

gwt browser interaction

First, the user enters the URL of your application, which triggers the browser to request the application’s HTML file. The HTML downloads a specifically named nocache.js file—the so-called bootstrap file. The bootstrap code determines which specific permutation of your application in JavaScript is required and then requests it. When the permutation is loaded, the bootstrap calls…

disable obfuscation in gwt css resources

Option 1 setting in gwt.xml use the the code that generates the aforementioned  very  long class names is present in the computeObfuscatedNames  method of com.google.gwt.resources.rg.CssResourceGenerator  class: Retaining the original class names is a very useful tool while development. (obfuscation is ideal for only production) Unfortunately, you can not override the above method which means we are stuck…