Re: Working polymer example?
I've left this alone in the hopes that it would mature with the 2.8 release, but I still cannot get a sample to run using the tutorial on the gwtproject site. I have followed the instructions neurotically a couple of times, but the only improvement from when I tried it in January is that now a element appears in the host page, but it has no styling and does nothing. the webcomponents.js does load into the page but it throws these errors into the browser console: <https://lh3.googleusercontent.com/-GvRoEovj5z8/V9IWcNFlHxI/AAo/dwOq0OErfhgJ-H6sSwiliFUrp-hvnH5sACLcB/s1600/clip.tiff> I am using maven 3.3.3 with GWT 2.8.0-rc2, polymer with vaadin-gwt-polymer-elements 1.2.3.0. It seems clear that many people are working with it, but I cannot find the proper incantation to get the sample project off the ground. I noticed that the gwt 2.8 webappcreator generates a pom using a different GWT plugin than it used to. Could that be a factor? Any other ideas? On Wednesday, January 6, 2016 at 11:06:43 PM UTC-8, Transplant wrote: > > > Can anyone point me to a working example of Polymer and GWT? The tutorial > on gwtproject.org does not compile with 2.7, and when you try it > with 2.8 snapshot it gives you a page with an empty iframe in it. > > Is anyone using it in a production application? > > Thanks in advance, > > -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Kendo UI GWT wrapper library
On Wednesday, January 20, 2016 at 2:16:37 AM UTC-8, Aron Homberg wrote: > > Hi everyone, > > I'm wondering if there is any need for a Kendo UI wrapper library. Kendo > UI is, as some of you may know, an enterprise front-end web/mobile > JavaScript library. It is based on jQuery and comes with a large set of > HTML5 widgets, themes, responsiveness etc. pp. It is also compatible with > Bootstrap and Angular JS [1]. > > Because there is (as far as I know) no GWT support for Kendo UI right now, > I started working on my own GWT wrapper library. The implementation is > based on GWT 2.8 JsInterop (final) and comes with UiBinder support (a > custom element for each Kendo widget). It has a declarative (markup) and a > programmatic interface. My goal is to cover all the 70+ Kendo UI widgets > soon. > > Please let me know if you are interested in such a GWT wrapper library for > Kendo UI. > > > Also interested here - any update? -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Working polymer example?
Yes - using maven with JSInterop enabled in the POM (it doesn't compile without it). On Wednesday, January 6, 2016 at 11:20:21 PM UTC-8, va...@ant.ee wrote: > > Do you use mojo Maven plug-in? Have you enabled JSInterop like tutorial > said? > -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Working polymer example?
Can anyone point me to a working example of Polymer and GWT? The tutorial on gwtproject.org does not compile with 2.7, and when you try it with 2.8 snapshot it gives you a page with an empty iframe in it. Is anyone using it in a production application? Thanks in advance, -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
GWT Compiler as a stand-alone javascript compiler?
Is there a way to use the GWT Compiler as a stand-alone javascript compiler to optimize/minimize pure javascript? If so, how does it stack up to other javascript compilers? Thanks, -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
GWT Designer + MGWT library = Runtime exception
I'm trying to use GWT Designer design mode with the mGWT mobile widget library. I can reference the library widgets in XML and compile/run just fine, but when I try to switch from XML Source mode to Design mode in GWT Designer I get a runtime exception: Internal Error encountered unexpected internal error. This could be caused by a bug or by a misconfiguration issue, conflict, partial update, etc. java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.user.client.impl.DOMImpl' (did you forget to inherit a required module?) The mgwt library is in the build path, and I can freely use its classes in UIBinder XML files, but it always barfs up when I try to enter design mode. Since mGWT defines a larger number of target platforms than vanilla GWT, is it possible that GWT Designer is asking the mGWT library to instantiate an implementation of DOMImpl for a platform that base GWT doesn't have - causing the above exception? Since most of the mobile platforms share the same or similar DOM implementation (a la webkit) is there some way for the mGWT library to tell GWT Designer to use a safari implementation of DOMImpl as the default? Thanks in advance, -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Can AutoBeanFactory encode ListBeanObject ???
Thanks Colin, That explains everything - my mistake was that I thought the framework would automagically use the MyFactory interface to figure out how to encode Lists of MyFactory objects. I still feel that it should be able to do that, but clearly it doesn't. For anyone else who gets confused by this - here is the working version of the test case: public void testThing () { Thing t1 = new Thing() { public String getName() { return one; } }; Thing t2 = new Thing () { public String getName () { return two; } }; MyFactory fact = GWT.create(MyFactory.class); AutoBeanThing t1Bean = fact.create (Thing.class, t1); AutoBeanThing t2Bean = fact.create (Thing.class, t2); String json = AutoBeanCodex.encode(t1Bean).getPayload(); System.out.println (payload: + json); final Thing [] pair = { t1Bean.as(), t2Bean.as() }; // putting bean-wrapped objects in the list works. Bunch b = new Bunch() { public ListThing getThings() { return Arrays.asList(pair); } }; AutoBeanBunch bunchBean = fact.create (Bunch.class, b); // The following throws NullPointerException :( json = AutoBeanCodex.encode(bunchBean).getPayload(); System.out.println (payload: + json); } On Jan 28, 3:30 pm, Colin Alworth niloc...@gmail.com wrote: You are on the right track for this, but you need to wrap each model with an autobean: encodeBean.as() is not the same instance as t1, even though it is obtained from the autobean that wraps t1. You need to wrap each instance, and include the wrapped instance in the eventual tree to be encoded. The list may also have trouble, it has been a while since I tried to build something like this out. The approach I've taken, rather than manually wrap the whole tree, was to wrap the root object, and use an autobean visitor to walk the rest of the properties, wrapping and continuing further down the tree. I found the code in com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.cl oneBeanAndCollections(AutoBeanT) to be helpful as a guide when copying autobeans, along with other aspects of the internals of RequestFactory, which is based on Autobeans for transport. -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Can AutoBeanFactory encode ListBeanObject ???
I can't seem to figure out how to tell AutoBeanFactory to encode/ decode lists of objects. I have a simple bean object with string- valued properties, and another bean object which has a list of the first object. When I try to encode, I get a NullPointerException from the AutoBeanCodex implementation. From the documentation in the wiki (http://code.google.com/p/google-web-toolkit/wiki/AutoBean) it appears that this is supposed to work, but what am I doing wrong? Here is my test case: public class BeanTest extends GWTTestCase { interface MyFactory extends AutoBeanFactory { AutoBeanThing thing (); AutoBeanBunch bunch (); } interface Thing { // simple bean with one string-valued property String getName (); } interface Bunch { // Simple bean with one ListThing valued property ListThing getThings (); } public void testThing () { Thing t1 = new Thing() { public String getName() { return one; } }; Thing t2 = new Thing () { public String getName () { return two; } }; MyFactory fact = GWT.create(MyFactory.class); AutoBeanThing encodeBean = fact.create (Thing.class, t1); String json = AutoBeanCodex.encode(encodeBean).getPayload(); System.out.println (payload: + json); final Thing [] pair = { t1, t2 }; Bunch b = new Bunch() { public ListThing getThings() { return Arrays.asList(pair); } }; AutoBeanBunch bunchBean = fact.create (Bunch.class, b); // The following throws NullPointerException :( json = AutoBeanCodex.encode(bunchBean).getPayload(); System.out.println (payload: + json); } } -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Custom UIBinder container - HOWTO??
What is the preferred method for creating a custom UIBinder container? I would like to implement a container class SuperSnazzyContainer, and then be able use it in a UIBinder template like so: mylib:SuperSnazzyContainer g:Label text=woo-hoo/ g:Button text=click-me/ /mylib:SuperSnazzyContainer What is the most straightforward way to implement such a beast?? Thanks in advance, -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Deferred locale selection/re-selection?
Hi, I need to write a multi-locale app that allows the user to change their locale at runtime. I would like to design the app so that I get the maximum benefits of GWT's deferred binding functionality with respect to locale. I must allow the user to log in to the app in one locale (say de-DE), and then later allow them to switch their locale setting to something else (say es-ES) without logging out. Ideally I would initially only load code and localization resources for the de-DE locale, and for most users that would be sufficient. Other users may wish to spontaneously change their locale, and at that point I would like to only load the code and localization resources for the new locale (es- ES or whatever). My problem is that the nocache.js script does its locale-specific code- swapping magic at boot time, and I would like to put that off until a bit later in the app. Can anyone recommend a strategy for achieving this design? Thanks in advance! -- 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-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: No UIBinder Event Handers in GWT 2.0?
On Dec 12, 11:01 pm, Sekhar sek...@allurefx.com wrote: Add it as a widget: RootPanel.get().add(demo); Ok, great noob gotcha. I knew it was something simple. I should have been able to figure that out in spite of the the dom-based example code in the UiBinder intro docs which only applies to non-widget UiBinder elements. For anyone else just jumping in to UIBinder, the old user interface documentation on user interface layout with FlowPanel, etc, has had an important UIBinder section added to it which is extremely useful. http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#LayoutPanels -- 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-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No UIBinder Event Handers in GWT 2.0?
The GWT 2.0 announcement got me all excited about the UIBinder, but I can't seem to make the demo event handlers function. Is there some module XML magic required to enable this? I created a new eclipse GWT project, and added demo code from the source release, and although the demo widgets are created and added to the page properly, none of the event handlers function. I tried manually adding ClickHandlers to the bound widgets, and that didn't work either. Clearly I'm missing something. I also noticed that the event handler code generated by the Eclipse Plugin's UIBinder generator for a widget-based UI failed to work either. Any insight or pointers are greatly appreciated. My demo project was created by: 1) Creating new GWT project in eclipse for GWT2.0 no AppEngine 2) Replacing all generated code with a demo EntryPoint (see below). 3) Adding the GWT HandlerDemo.java and HandlerDemo.ui.xml 4) Setting the HandlerDemo package name to the project package No joy :( Module XML - GWT2Demo.gwt.xml: --- ?xml version=1.0 encoding=UTF-8? module rename-to='gwt2demo' inherits name='com.google.gwt.user.User'/ inherits name='com.google.gwt.user.theme.standard.Standard'/ entry-point class='demo.client.GWT2Demo'/ source path='client'/ /module === EntryPoint class - GWT2Demo.java: -- public class GWT2Demo implements EntryPoint { public void onModuleLoad () { HandlerDemo demo = new HandlerDemo (); Document.get().getBody().appendChild(demo.getElement()); } } === Handler Demo code from Google: --- http://code.google.com/p/google-web-toolkit/source/browse/releases/2.0/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java http://code.google.com/p/google-web-toolkit/source/browse/releases/2.0/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.ui.xml === Development Environment: Eclipse 3.5/GWT Plugin Java 1.5 -- 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-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
what module contains com.google.gwt.core.ext.typeinfo.* ??
I'm trying to do some work with GWT Generators, but I cannot find a module which will allow me to access the classes in com.google.gwt.core.ext.* com.google.gwt.core.ext.typeinfo.* The documentation is sketchy, but it seems from the build files that inherits name=com.google.gwt.core.Core/ is supposed to grant access to these classes, but it doesn't work for me - I still get: No source code is available for type com.google.gwt.core.ext.Generator; did you forget... No source code is available for type com.google.gwt.core.ext.typeinfo.TypeOracle; did you forget ... when I try test anything. I have inherited from every module I could find that doesn't break the module XML parsing to no avail. Can anyone shed some light getting access to these classes? --~--~-~--~~~---~--~~ 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-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: what module contains com.google.gwt.core.ext.typeinfo.* ??
Ok, so I figured it out - it's not supposed to be inherited as a module. Because the Generator stuff is all at compile time you can't have your Generator classes in packages under the client source tree (unless you specifically exclude them in a source tag). So to anyone who is starting to work with the compile-time code generation facilities, be sure to keep your compile-time code out of your client package tree, or you will get the dreaded 'No source code is available for type' errors. --~--~-~--~~~---~--~~ 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-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Double click in GWT 1.6?
On Jun 4, 11:54 pm, Liv nira.dietr...@googlemail.com wrote: Try this: public class DoubleClickListBox extends ListBox implements HasDoubleClickHandlers{ OH! The Rich Chocalaty Goodness of the new event framework! Thanks for the pointer - its clean, its elegant, and most importantly in this case it works well on IE6! Thanks again! --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Double click in GWT 1.6?
Is there an approved method for trapping double click on a widget (specifically a ListBox element) in GWT 1.6. I had been using sinkEvents/onBrowserEvent technique originally presented a href=http://groups.google.com/group/Google-Web-Toolkit/ browse_thread/thread/2cbc631e306be73b/2dfc0c7297e4bb6f?lnk=gstq=double +click#2dfc0c7297e4bb6fhere/a but that doesnt seem to work anymore on IE6. Still seems to work everywhere else though. Does anyone know if there is a New And Improved (TM) way to do this with the new event handlers in GWT 1.6?? Thanks in advance! /** Double Click Sample **/ class DoubleClickListBox extends ListBox { public DoubleClickListBox () { super (true); } protected void onLoad() { sinkEvents(Event.ONDBLCLICK); } public void onBrowserEvent (Event event) { if (DOM.eventGetType(event) == Event.ONDBLCLICK) { Element target = DOM.eventGetTarget(event); // Firefox targets OPTION, IE targets SELECT if (DOM.getElementProperty (target, tagName).equals(OPTION)) { target = DOM.getParent(target); } if (this.getElement().equals(target)) { processDoubleClickSomewhere (); } } else super.onBrowserEvent (event); } } --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Dimming page background while Dialog is displayed.
Hi, I would like to put up a dialog and dim or grey-out the entire page/app background while the dialog is up. What tricks or techniques are people using to do this with GWT? Thanks in advance! --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
What happened to the incubator YouTube widget?
A few months back there was a youtube widget in the GWT incubator. It seems to have vaporized. Does anyone know what happened to it or have pointers to the code? You can see a screen shot of the old widget here: http://www.gwtnow.com/2008/09/04/gwt-incubator-whats-in-it/ I'd think that a youtube widget would be extremely popular and useful, does anyone know why it was removed from the incubator? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: What happened to the incubator YouTube widget?
Ok I found the YouTubeViewer in the incubator, its just not listed in the widget documentation. It is in the incubator jar, and the API docs, there's just aren't any other docs or demos for it. It works well though - very cool. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Anyone configure GWTShell to listen on a network interface?
On Feb 6, 3:01 am, Lore laurent.vanderlin...@gmail.com wrote: you need to compile (from the shell or command line) with the current version of GWT I'm using GWT 1.5.3 which is the current version? I don't understand how this relates. Thanks --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Anyone configure GWTShell to listen on a network interface?
Has anyone dug into GWTShell's tomcat configuration to figure out how to make it listen on a real network port? I'd like to make it listen on a real network interface (instead of loopback) so that I can connect and test multiple clients with different OS/version combinations. Anyone? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Hyperlinks dont work on IE7??
I'm having a problem with Hyperlinks not working on IE7. It appears that there was a similar bug reported some time back with non-GWT tokens in IE7, but my problem appears to be a bit different (total hyperlink failure). The following code works fine on Safari/FireFox, but does nothing on IE7. This test just inserts the Hyperlink history token into a status element. The host page must have one div in it with the id page. --- SNIP SNIP --- public void onModuleLoad () { // Create some links HorizontalPanel hpane = new HorizontalPanel (); hpane.add (new Hyperlink (One, one-token)); hpane.add (new Hyperlink (Two, two-token)); hpane.add (new Hyperlink (Three, three-token)); // Create a place to catch tokens HTML status = new HTML (Status: ); status.getElement ().setAttribute (id, status); // Stick them in the page element RootPanel root = RootPanel.get (page); root.getElement ().setInnerHTML (); root.add (hpane); root.add (status); // Setup history tracking History.fireCurrentHistoryState (); History.addHistoryListener (new HistoryListener () { public void onHistoryChanged (String historyToken) { RootPanel s = RootPanel.get (status); s.getElement ().setInnerHTML (Status: [ + historyToken + ]); } }); } --- SNIP SNIP --- Any clues?? --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Hyperlinks dont work on IE7??
Just thought I would add - I'm using GWT 1.5.3. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Problem Solved
Problem solved - the history iframe was missing from the HTML file. I should have checked that first, but the fact that it was working fine in Firefox/Safari threw me off. --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Page navigation in GWT
On Nov 21, 1:02 pm, jonbutler88 [EMAIL PROTECTED] wrote: Hi all I am new to GWT, though I have dabbled in C#/Java before so the language itself doesn't boggle me that much, but it seems some of the simpler concepts aren't sticking. Im pretty sure the answer to my question is so obvious, as I have not seen it answered in any of the tutorials on GWT on the web. What I wanted to know is, how do you do page navigation in GWT? For example I have my new class, with its onModuleLoad function, which is fine, but say I want to click a link and load a new page with a different onModuleLoad function? As others have pointed out, the Right(TM) way to do this is using the History mechanism. There are many strategies for working this into your application's internal syntax and structure. However, there are a few other basic concepts I think you might want some clarification on. First, you should think of your GWT app as a single HTML page, in which user and application events cause PORTIONS of the page (ie DOM elements) to change, be replaced, or loaded with content from the server or internal application logic. In general you will not be sending the user/browser to another real URL. Your initial HTML page is basically a canvas on which your GWT application spews up content in response to user or server events (the typical AJAX model). In the example of your login function, when your app has successfully received authentication credentials from the user, its next job will be to kick the login widgets off the page, and replace them with whatever is next. Second, you will probably find that the majority (if not all) of your user navigation paths are not coded in raw HTML. The GWT ui classes provide all the event handling and navigational connectivity that you would find in a typical desktop application. Although it is possible use raw HTML links to navigate your application, the GWT widgets are much easier to work with, test, and maintain than raw HTML files. So instead of following an a href=blah blahblah/a and going somewhere else, you will create event listeners that respond to mouse or key clicks which cause your app to change what is already there. Finally, you typically will only have one EntryPoint implementation with an onModuleLoad method in your application. That class will be responsible for initializing your application - probably by creating classes for the UI, classes for handling UI events, and classes for managing your applications internal state. In a lot of the samples, the class which implements EntryPoint also implements all of the UI, the event handlers, and the application logic, but that's only to reduce the amount of code you have to read. In any serious application you will want to factor those things out into different classes (as in MVC). It might be helpful to think of your EntryPoint.onModuleLoad() as if it were simply the main() method of a more traditional application. Hope that helps! --~--~-~--~~~---~--~~ 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-Web-Toolkit@googlegroups.com 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 -~--~~~~--~~--~--~---