{{theTime}}

Search This Blog

Total Pageviews

Showing posts with label GWT. Show all posts
Showing posts with label GWT. Show all posts

GWT DockLayoutPanel


DockLayoutPanel dlp = new DockLayoutPanel(Unit.EM);
dlp.addNorth(new HTML("header"), 2);
dlp.addSouth(new HTML("footer"), 2);
dlp.addWest(new HTML("navigation"), 10);
dlp.add(new HTML("HTML Contents"));
Do not mention center panel size, the remaining space will be allocated to the center panel.

Adding a Google AJAX SearchControl to the page


Adding a Google AJAX SearchControl to the page

Let's create a basic but nicely formatted search box and the corresponding results using web and image results. Here we use the API's built in HTML rendering.
Replace the contents of your onModuleLoad method with the following:
public class Search implements EntryPoint {

  public void onModuleLoad() {

    SearchControlOptions soptions = new SearchControlOptions();
    WebSearch wSearch = new WebSearch();
    wSearch.setResultSetSize(ResultSetSize.LARGE);
    soptions.add(webSearch);
    ImageSearch iSearch = new ImageSearch();
    options.add(iSearch, ExpandMode.OPEN);
    final SearchControl scontrol = new SearchControl(soptions);
    scontrol.execute("treehouse");
    RootPanel.get().add(control);
  }
}

[ERROR] Unable to start AppEngine server java.lang.RuntimeException: Unable to restore the previous TimeZone


 [ERROR] Unable to start AppEngine server
java.lang.RuntimeException: Unable to restore the previous TimeZone
at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:290)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:228)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:119)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.lang.NoSuchFieldException: defaultZoneTL
at java.lang.Class.getDeclaredField(Class.java:1882)
at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:284)

To resolve the above issue set the following JVM argument.

-Dappengine.user.timezone.impl=UTC

How to schedule a work using Timer in GWT -- Auto Refresh functionality

Scheduler can be used for automating the repetitive tasks and for auto refresh. Simple example how to create timer in GWT.

Timer timer = new Timer() {
public void run() {
Window.alert ("Updated score! details..");
}
};

// Execute the timer to expire 5 seconds in the future
timer.schedule(5000);

How to wire objects returned from an RPC mechanism into a UI using Editor

See the detailed explanation how to wire objects returned from RPC into UI.
https://developers.google.com/web-toolkit/doc/latest/DevGuideUiEditors#Quickstart

Iphone ViewPort width

To view the GWT apps in iphone, the viewport width has to set to 320 in header tag.


Read http://code.google.com/webtoolkit/articles/gwt-iphone.html for more details

Optimizing Java Applications for Low-Latency Microservices

Introduction Microservices architecture has become a go-to for building scalable, modular systems, but achieving low latency in Java-based...