Any suggestions if we want to include the same widget more than once in the page? (e.g. two calculators on one html page)
On Jul 7, 11:00 am, Ian Bambury <[email protected]> wrote: > Hi, > > 'Embed' isn't actually going to find you the right info, unfortunately. Or > at least, not much. What you need to know is how GWT works. > > For something like this, you need to have your GWT app add your Calc widget > to a div in the html page. > > A simple way to do this is to put a <div id=calc></div> in your html page > and also include the gwt script (i.e. the one referencing the nocache js > file). > In the GWT app, have the onModuleLoad method do a > RootPanel.get("calc").add(new MyCalc()); > > This is unsafe inasmuch as if the element with the id is missing, you'll get > an error. > > You could check if the element with the id is there and if it is, add a > calculator. In this way, you could have your app insert widgets if it finds > the right id, so one app could be reused if pages need, say, a calculator, a > stockticker, or both (and not crash if it needs neither). > > If you need more info, just yell. > > Ian > > http://examples.roughian.com > > 2009/7/7 Arne Schroeder <[email protected]> > > > > > > > Hi all, > > searching this group for "embed" I found several examples how to embed > > Flex/Flash/Webapplications into GWT, but no simple thing like > > embedding GWT widgets in a pure HTML page (maybe combined with extra > > javascript). > > > I have just started using GWT. I built a very simple calculator widget > > from a few buttons and a text field, which runs fine as a web > > application. This calculator needs no client-server communication, so > > that I believe I should be able to copy the generated js files and > > helper files to the right places and thus embed the calculator in > > other webpages. > > > Can I find such a description somewhere, how to use the compiled GWT > > output as custom javascript widgets? > > > Thank you > > Arne --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
