You can do this quite easily. Just compile your widgets as it were separate projects (each with their own Entrypoint and onModuleLoad functions).
Now to be able to use methods from widget1 by widget2, you'll have to 'export' the functions from widget1 that you want to be used to javascript. See http://code.google.com/p/gwtchismes/wiki/Tutorial_ExportingGwtLibrariesToJavascript_en how to do this. In widget2 you can now make a JSNI function that calls the 'exported' javascript function from widget1. Good luck, Menno. On 31 dec 2009, 14:04, Ganesh <[email protected]> wrote: > Hi All > > I am using GWT2.0. I want to create some client side widgets by > extending GWT's widgets. These widgets will be deployed on my server & > I will provide public links of js (.nocache.js) file of these widgets > so that a user can include these in his application's html page & use > them. I will deploy many of such widgets on my server. If a user wants > to use more than one widget, he need to include js file of each widget > in his html file. Each widget will have it's own module. > > Further my widgets can be dependent on each other. Suppose Widget1 is > dependent on Widget2 & user wants to use Widget1, he needs to include > js of both widgets (Widget1 & Widget2) in his html file. > > Now my problem is > - How to compile my Widget1's module so that while compiling Widget1, > it doesn't generate js for Widget2 as it will be provided to it at run > time (as user will include Widget2's js file in his html file). > - How Widget1 will be able to use Widget2 & it's method as GWT > obfuscates all java code at compile time. I can't choose option for > not obfuscating code due to size of js & security issues. > > Kindly also consider that I would like to compile Widget1 & Widget2 > separetly & a new version of Widget2 can be compiled at any time. > After this compile, changes done in Widget2 shd reflect while it is > being used through Widget1 without compiling Widget1 again. > > Any help/suggestion in this regard will be highly appreciable. > > Thanks in advance. > > Ganesh Bansal
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
