Created
April 27, 2012 05:25
-
-
Save YusukeKokubo/2506139 to your computer and use it in GitHub Desktop.
Hello GwtQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd"> | |
<module rename-to="hello"> | |
<inherits name="com.google.gwt.user.User" /> | |
<inherits name='com.google.gwt.query.Query' /> | |
<source path="client" /> | |
<entry-point class="as.client.Hello"></entry-point> | |
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package as.client; | |
import static com.google.gwt.query.client.GQuery.$; | |
import com.google.gwt.core.client.EntryPoint; | |
import com.google.gwt.query.client.Function; | |
import com.google.gwt.user.client.Event; | |
public class Hello implements EntryPoint { | |
@Override | |
public void onModuleLoad() { | |
$(".submit").click(new Function() { | |
@Override | |
public boolean f(Event e) { | |
$("label").text($(".name").val()); | |
return true; | |
} | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>index</title> | |
<script type="text/javascript" language="javascript" src="hello/hello.nocache.js"></script> | |
</head> | |
<body> | |
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> | |
<p>Hello: <label>hogehoge</label></p> | |
<input class="name" type="text" name="name" /> | |
<button class="submit" type="submit">send</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment