How to share classes between two different modules with two different pages

210 views
Skip to first unread message

Deepak Singh

unread,
Mar 20, 2012, 5:22:58 PM3/20/12
to google-we...@googlegroups.com
Hi All,

I have a GWT project with 2 modules.

ModuleA  and ModuleB
Both are having their own html page. i.e. tow seperate html pages so seperate Rootpanel for both of them.

So i cant inherit one into another.

How can i use the same class(in shared package) in both the modules ?



Thanks 
Deepak Singh

Олександр Бежан

unread,
Mar 21, 2012, 3:18:02 AM3/21/12
to google-we...@googlegroups.com
I think the best way you can do this is to create third gwt module ('common' for example) and move all common classes there.
Then you can inherit this module and access to common classes.

вторник, 20 марта 2012 г. 23:22:58 UTC+2 пользователь Deepak Singh написал:

Andrew Scully

unread,
Mar 21, 2012, 8:51:51 AM3/21/12
to google-we...@googlegroups.com
It sounds like you just need two separate gwt.xml files within the same project. There is no reason why you can't use the same inherits within both.

Deepak Singh

unread,
Mar 21, 2012, 11:16:46 AM3/21/12
to google-we...@googlegroups.com
Yes i have two seperate *.gwt.xml for both the modules.
And i inherit ModuleB into moduleA as follows:

ModuleA.gwt.xml
<inherits "com.pdstechi.modulenameB.ModuleB">

And then i use
 com.pdstechi.modulenameB.shared.AbcDto   into com.pdstechi.modulenameA.client package, it fails compilation with message 

'Source code for   com.pdstechi.modulenameB.shared.AbcDto  is not available'.

Thanks
Deepak

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/2pEfxrUOUdQJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Matias Costa

unread,
Mar 21, 2012, 5:59:25 PM3/21/12
to google-we...@googlegroups.com
I would create a base module from which A and B inherit.

Or you can try in moduleB.gwt.xml

<source path="../moduleA/client" />

Deepak Singh

unread,
Mar 22, 2012, 9:46:07 AM3/22/12
to google-we...@googlegroups.com
It did not work.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Matias Costa

unread,
Mar 22, 2012, 11:03:40 AM3/22/12
to google-we...@googlegroups.com
And you have in moduleB.gwt.xml ?

<source path="shared" />

El jueves 22 de marzo de 2012 14:46:07 UTC+1, Deepak Singh escribió:
It did not work.


Deepak Singh

unread,
Mar 22, 2012, 11:45:42 AM3/22/12
to google-we...@googlegroups.com
Yes.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Fernando Varella Lopes

unread,
Mar 23, 2012, 10:00:51 AM3/23/12
to google-we...@googlegroups.com
i think that you can make a new module for the classes you want use in other two, and inherit it.
Reply all
Reply to author
Forward
0 new messages