Multiple pages tutorial in Google Web Toolkit (GWT)

What I usually do in situations like this is design the webpage framework first. I’ll have a div for the header, side menu and footer. I’ll also have a div in my HTML for the main content. Example: <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta name=”gwt:module” content=”org.project.package.Core=org.project.package.Core”> </head> <body> <!– Load the JavaScript code for GWT –> <script … Read more

GWT Custom Events

Events in general: Events are always sent to inform about something (e.g. a change of state). Let’s take your example with a man and a wall. Here we can imagine that there is a game where a user can walk as a man in a labyrinth. Every time a user hits the wall it should … Read more

Achieving min-width with viewport meta tag

So you want to change the viewport tag’s width dynamicaly . Here you go : <meta id=”myViewport” name=”viewport” content=”width = 380″> <script> window.onload = function () { var mvp = document.getElementById(‘myViewport’); mvp.setAttribute(‘content’,’width=580′); } </script> See:http://www.quirksmode.org/mobile/tableViewport.html

Regular Expressions and GWT

The same code using RegExp could be: // Compile and use regular expression RegExp regExp = RegExp.compile(patternStr); MatchResult matcher = regExp.exec(inputStr); boolean matchFound = matcher != null; // equivalent to regExp.test(inputStr); if (matchFound) { // Get all groups for this match for (int i = 0; i < matcher.getGroupCount(); i++) { String groupStr = matcher.getGroup(i); … Read more

How to print to the console in GWT

Quoting the documentation: Adding GWT logging is really quite simple, as simple as the following code example. However — understanding how logging works, and how to correctly configure it is important, so please do take the time to read the rest of this document. http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html The simplest way to enable logging is: # In your … Read more