Welcome Guest, Not a member yet? Register   Sign In
Integrating Google Web Toolkit (GWT 2.0) with CodeIgniter
#1

[eluser]Bogdan Tanase[/eluser]
Hi everyone,

Since it took me a while to figure out how to use GWT with CI, I wrote a short tutorial maybe it will be useful to someone (or myself after a few months Smile) )

Integrating GWT with CI
#2

[eluser]Jamie Rumbelow[/eluser]
A nice little tutorial - thanks for contributing to the community!

Jamie
#3

[eluser]Hartimer[/eluser]
Little tricks that are going to save me alot of time!

I'll try to write a tutorial about GWT <-> JSON <-> PHP interaction soon (prolly will have to ask someone to post that for me)

Anyway, thanks alot
#4

[eluser]ascuellar[/eluser]
Hi Bogdan first of all, thank you for this great tutorial. I just have a few questions. I use wampp and when I compile the gwt project the PATH_TO_SERVER_APP there I use is -war c:\wampp\www\gwttest. This is correct?. I ask you this because when I compile the project inside the gwttest folder it creates a folder with the result of the compilation. My project is called Test so the name of the folder is also test.

So here comes the more important question.

In this section <div id = "gwt_container"> </div>. Here I should replace the gwt_container with the name of something there I have in my root panel right?

And the other question is, if my project name is test, the GWT_MODULE should be test?.
For example:

test/test.nocache.js

The reason why I am asking you those questions is because when I run my app with this path

http://localhost/gwttest/test/showgwt?gw...0.0.1:9997

It shows the html content but the gwt content doesn't appear. So I don't know what am I donig wrong.

I would appreciate your help.
#5

[eluser]Bogdan Tanase[/eluser]
Hi ascuellar,

- Your module name is usually like the .gwt.xml file or defined by the rename-to clause in the same xml

Code:
<module rename-to='test'>
    ...

- the <div id = “gwt_container”> </div> is optional. This is used if you want to display the gwt app in a certain container instead of the page body.

To do this in you java file you'll have

Code:
RootPanel.get("gwt_container").add(yourWidget);

- Now assuming your module name is "test" and your CodeIgniter application is in the folder gwttest you should have the following directory structure:

Code:
-gwttest
--controllers
--models
--views
--test
---test.nocache.js + a lot of other files
--index.php -> your CI bootstrapper

Your layout may be different especially if you use the default CI installation.

The basic idea is to write in your view the path to the module relative to the index.php file (because all you requests go through that file).

If you need further help, let me know.
#6

[eluser]ascuellar[/eluser]
Hi, thanks a lot about this. So I have another question, how can I interact or how can I add php variables to the gwt view. Is this possible. Or what I have to do is interact with GWT -> JSON -> PHP. Can you guide me?. Thanks a lot.
#7

[eluser]Bogdan Tanase[/eluser]
You'll probably want to do AJAX requests to the php server. Send a request, get a response (probably JSON) - asynchronously. I recommend reading [urlhttp://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests]this section[/url]. It's not too hard.

Although lately I've moved to pure java environments, If I get some time the next days I'll write a tutorial about server side communication and my approach with CI.
#8

[eluser]ascuellar[/eluser]
Thanks for your answer. I'll be waiting for the tutorial.
#9

[eluser]Hartimer[/eluser]
Codeigniter has a builtin XML RPC library... works preatty well with GWT.
Like Bogdan Tanase mentione, check the GWT HTTPRequest class, along side CI User Guide
#10

[eluser]ascuellar[/eluser]
Hi, do you have an example of the implementation of XML RPC with GWT. I would appreciate your help. Is just there I'm to newbie on this stuff.




Theme © iAndrew 2016 - Forum software by © MyBB