- Java 1.6
- Eclipse 3.5
- GWT Designer 7.1
- GWT 1.7
- SmartGWT 1.2
- Apache/PHP 2.0/5.2.9
The idea is setup an eclipse project, use SmartGWT that it can deploy to another php project (with param -noserver) and run in debug mode . The ideally way is we can just change code in Eclipse without restart server or refresh browser. Example click on button Click me then show popup message "Hello GWT", then change message to "Hello SmartGWT", and just click button again.
Here are my study in a Sunday noon, after try to use Helloworld 1.6 is included in smartgwt1.2.zip
- Step 1: New a GWT project with a example module (GWT Design will automatically add gwt_user.jar to project)
- Step 2: Add two libraries are smartgwt.jar and smartgwtskin.jar (name of libraries may be wrong :P)
- Step 3: Run compile project to folder war
- Step 4: Edit file war/module_name.html add these lines to
<!-- IMPORTANT : You must set the variable isomorphicDir to [MODULE_NAME]/sc/ so that the SmartGWT resource are correctly resolved -->
<script> var isomorphicDir = "helloworld/sc/"; </script>
- Step 5:
Copy folder war to php project. We can test on Firefox with url: /war/ .html. If it work well, copy url
- Step 6:
Open run configuration, new or edit (if existed) project run configuration and do: check noserver and patse the url. Then click apply.
- Step 7:
Run in debug mode
- Step 8:
May be Hosted server throws error "Invalid module ...xxx". Don't afraid! Just click Hosted Browser and paste url to it.
- Step 9:
If url can not run and hosted server still throw errors. Try refresh the hosted browser, because IE may be cache file.
- Step 10:
Change code in Eclipse and test on browser.
That's all. Some errors which I met are
Invalid module (always meet) Could not find helloworld.gwt.xml in your classpath (error when I use helloworld 1.6 project include in smartgwt1.2.zip) Could not find $wind.isc (may be cache, or you do not copy right files and folders)
Now code for fun!!!