Re: What is server side script selection
Sounded to me like it does the same thing that the [modulename].nocache.js file does. only it does it on the server rather than in the client, reducing the number of connections required, as well as the bytes transferred. -jason On Oct 24, 2009, at 11:56 PM, balachandra maddina wrote: Hi There, I've just seen the Google Wave video in the i/o session web page and one of the interesting talks in it is Server Side Script Selection. i tried finding any details available on it but got no results. could any one share the details of Server Side Script Selection. probably a link or something please. your help is much appreciated. Thank you, bala. --~--~-~--~~~---~--~~ 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: UiBinder example, where does Spa
At the risk of back posting, I have managed to get further with getting a UiBinder based interface going, but get this error 01:12:52.420 [ERROR] Line 20: No source code is available for type com.google.gwt.uibinder.client.UiBinderU,O; did you forget to inherit a required module? I have checked agains the Mail app and I am importing all necessary modules, anything obvious I could be missing? On Sun, Oct 25, 2009 at 4:01 PM, Devraj Mukherjee dev...@gmail.com wrote: Hi all, First of all please bare with me as this is my first attempt at getting something going with GWT. I am looking at the Wiki entry for UiBinder and am trying to get the HelloWorld sample going http://code.google.com/p/google-web-toolkit/wiki/UiBinder The interface definition reads interface MyUiBinder extends UiBinderDivElement, HelloWorld {} As I understand DivElement is the Root Element in the UI definition. Where should I import DivElement from, in my .java file? Thanks. -- The secret impresses no-one, the trick you use it for is everything - Alfred Borden (The Prestiege) -- The secret impresses no-one, the trick you use it for is everything - Alfred Borden (The Prestiege) --~--~-~--~~~---~--~~ 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: Web Application in Regional Language
Tanks for your answer Mr.Tamas --~--~-~--~~~---~--~~ 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: How do I boostrap my Entry Point class with the User service?
This tutorial might help, particularly section 3 that covers using AppEngine User service in GWT : http://code.google.com/webtoolkit/tutorials/1.6/appengine.html //Adam On 24 Okt, 19:43, nacho vela.igna...@gmail.com wrote: Hi, im developing an aplication in gwt and i have an entry point class. What i do no realize how to do is how to only permit access to the user that is logged using the user service (http://code.google.com/appengine/docs/java/gettingstarted/usingusers ) Do i have to put something in the web.xml? Can somebody please help me? Thanks a lot. --~--~-~--~~~---~--~~ 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 eclipse plugin icons do not display on Windows 7
After installing the GWT plugin for Eclipse on my Windows 7 pc, I quickly noticed that the GWT icons were not displayed in the Eclipse task bar. I repeated the installation instructions several times, uninstalled the plugin, reinstalled... Finally, I decided to try running Eclipse with the Run as Administrator option. This time the plugin install worked perfectly and the GWT icons are now showing up correctly. To Run as Administrator, right-click on the Eclipse icon, select the Run as Administrator option. I'm not sure what the problem was/isbut I thought I'd post my results for others if they run into this same issue. Regards, John --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Will RequestBuilder in upcoming 2.0 support PUT and DELETE?
I want to call server side RESTful service by RequestBuilder, but it currently only support GET and POST, any plan to support PUT and DELETE in upcoming 2.0? --~--~-~--~~~---~--~~ 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: Native JSON and safe parsing implementation
Thanks for the reply and the source reference. I hadn't seen that class...it would be nice to pull that method into (maybe) JsonUtils so that it would be in the core and more visible. The RFC and the json2.js code (here: http://www.json.org/json2.js ) were both written by Douglas Crockford. The main difference seems to be that the json2 code has been updated since the RFC was written to deal with how javacript handles certain unicode characters (which will cause erroneous parsing without escaping them) and to speed up the regex testing in older versions of IE and Safari. These are the first and second stages, respectively, as reference in the code above and in the json2 code, with more explanation there. However, the more important difference is that if a browser can natively parse the JSON string, the json2 code (and thus the class in my OP) will default to the native implementation. Besides the obvious speed advantage to doing the parsing in native code, there are some other problems with pure-js parsing. Most of the points on this page are still true: http://ejohn.org/blog/native-json-support-is-required/ Anyway, obviously all that doesn't invalidate the current implementation. Mostly this seems like an interesting case where deferred binding would be the usual approach, but the delineation of browsers with native JSON support doesn't match the current way the browser targets are defined, necessitating a different approach. Is there anywhere else in the codebase where native features are supported similarly? I can think of something like getElementByID, but that was added so long ago its probably a pretty clear case when native support can be used Thanks again. On Oct 24, 10:28 pm, Sripathi Krishnan sripathi.krish...@gmail.com wrote: You should take a look athttp://tools.ietf.org/html/rfc4627 GWT recommends using the regular expression defined in that RFC. Also, one of their classes (ExternalTextResourcePrototype.java) defines the Regular expression and runs eval.. so you could use the same strategy. See method evalObject inhttp://code.google.com/p/google-web-toolkit/source/browse/changes/bob... Source Code - /** * Evaluate the JSON payload. The regular expression to validate the safety of * the payload is taken from RFC 4627 (D. Crockford). * * @param data the raw JSON-encapsulated string bundle * @return the evaluated JSON object, or codenull/code if there is an * error. */ private static native JavaScriptObject evalObject(String data) /*-{ var safe = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test( data.replace(/(\\.|[^\\])*/g, ''))); if (!safe) { return null; } return eval('(' + data + ')') || null; }-*/; --Sri 2009/10/23 Brendan bcke...@gmail.com I realize this post is coming at the end of the day on friday, but hopefully it will get a look =) Going through the different JSON parsing implementations available for GWT out there, almost all of them rely on a straight eval and note that they should only be used for trusted code. The old JSONValue code seems kind of quaint in light of JavaScriptObjects, and looking through the trunk it looks like there's just a TODO in JsonUtils for safe parsing. Anyway, I don't have that much experience writing JSNI code, so I wanted to run this small class past you all and see if this aligns with GWT best practices, if I'm doing anything monumentally stupid, or if I'm just plain missing something. The following is a pretty basic adaptation of Douglas Crockford's json2.js. When parse() is called, it checks to see if there is a native JSON defined (which exists in the latest IE, Firefox, Chrome and Safari) and simply uses that. If not, it defines a $wnd.JSON.parse in javascript using the json2 code, which is then indistinguishable from the native functionality in future calls (this tactic comes straight from json2.js). It lazily initializes the JSON object, as defining an entry point doesn't seem like a big win, and adds a lot of support necessary to make it happen. It also defines it on the $wnd object...scope still occasionally confuses me in javascript, but it seemed to make more sense to define it there than on window. Any thoughts? Even drive by comments are useful if it gives me enough to google. Thanks! The code: /** * Evaluates a JSON string safely * * @param T The type of JavaScriptObject that should be returned * @param jsonString The source JSON text * @return The evaluated object * @throws NullPointerException if codejsonString/code is codenull/code * @throws IllegalArgumentException if codejsonString/code is empty * @throws JavaScriptException if codejsonString/code is non- parseable */ public static final T extends JavaScriptObject T parse(String jsonString) { if (jsonString == null) { throw new NullPointerException();
Re: EasyMock for GWT + MVP ?
Your error looks like you're using the EasyMock class extensions and are missing cglib jars from your build path. As it happens, I recently produced a getting started with MVP and unit testing with EasyMock article which might be of use: http://blog.hivedevelopment.co.uk/2009/10/introduction-to-mvp-unit-testing-part.html Cheers, Chris. On Oct 25, 4:58 am, fker...@gmail.com fker...@gmail.com wrote: I remember EasyMock didn't work for GWT, because it needed reflection, which wasn't available for client side programming. However, I'm doing MVP tests, so the code need not run in hosted mode, so EasyMode should run... right? However, I'm getting the following error -- can somebody point me in the right direction? java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer at org.easymock.classextension.internal.MocksClassControl.createProxyFactory (MocksClassControl.java:78) at org.easymock.internal.MocksControl.createMock(MocksControl.java: 50) at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46) at com.fkereki.mvptest.client.LoginPresenterTest.setUp (LoginPresenterTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall (FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run (ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively (FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336) ... 27 more --~--~-~--~~~---~--~~ 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: Will RequestBuilder in upcoming 2.0 support PUT and DELETE?
On 25 oct, 09:47, Fangzx fangzhoux...@gmail.com wrote: I want to call server side RESTful service by RequestBuilder, but it currently only support GET and POST, any plan to support PUT and DELETE in upcoming 2.0? See http://code.google.com/p/google-web-toolkit/issues/detail?id=3388 (with workaround and patch) --~--~-~--~~~---~--~~ 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: A strange setting for MVP
On 24 oct, 23:54, fker...@gmail.com fker...@gmail.com wrote: I have been studyinghttp://blog.appenginefan.com/search/label/Schluesselmeister application, and that got me to thinking about MVP... In that example, Display is about the same as View, and Controller is like Presenter. You inject the View to the Presenter through its constructor... but then the Presenter injects itself into the View by doing something like View.setPresenter(this); There are benefits, but having the View know about the Presenter seems odd. You could have: LoginPresenter.View interface: String getName( ); String getPass( ); void setPresenter(Presenter p); LoginView.Presenter interface: tryToLogin( ) LoginPresenter implements LoginView.Presenter with something like: // call a remote service with myView.getName( ) and myView.getPass ( ) // on callback, if the service agrees, initialize everything, show the menu, etc. LoginView implements LoginPresenter.View with something like: // add a click handler to its login button // which will call presenter.tryToLogin( ) The LoginPresenter constructor looks like LoginPresenter(LoginView view ...and some other parameters...) myView = view; myView.setPresenter(this); ... This way of implementing things doesn't require sending events from the view to the presenter, or the presenter providing callbacks to the view... but somehow looks weird to me... any thoughts on it? I'd rather use the following, though I understand why the LoginView.Presenter interface could help with mocking (it's easier to mock the view then, because you don't have to mock HasClickHandlers and eventually HandlerRegistration and ClickEvent): LoginPresenter.View interface: String.getName() String getPass() HasClickHandlers getSignInButton() The LoginPresenter constructor looks like: LoginPresenter(LoginView view ...and some other parameters...) this.view = view; view.getSignInButton().addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { tryToLogin(); } }); --~--~-~--~~~---~--~~ 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: MVP: get/set and callbacks
On 24 oct, 14:39, Eduardo Guerrero eduardo.guerrero...@gmail.com wrote: I have been trying out the MVP idea, and these are some points (read, doubts) I have come up with. * I do not like the HasValueString suchAndSuchField interface; it's too low level in my opinion, and harder for testing. I have been toying with using String getSuchAndSuchField and void setSuchAndSuchField(String s), which I think is more high level, and allows mocking the view more easily. But HasValue? is also a HasValueChangeHandlers. But when I don't need value change events, I use a getter and setter. * I also think that seting the handlers from the Presenter is also low level; I'd rather have the view set its own handlers, and communicate with the presenter by means of callbacks. The view needs implement void setOnClickedLogin(AsyncCallback cb) and will use the callback on its click button handler, or whatever. For example, you could call the callback both on blur (whenever you exit the password field) or on clicking the login button; the presenter needs just know that it's time for validating the login, by using the getSuchAndSuchField(...) calls. Any opinions, kudos, flames ... ??? I don't really buy your argument about low level vs. high level. I see MVP as much more pragmatic and close to metal than e.g. MVC; particularly when using a passive model. --~--~-~--~~~---~--~~ 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: GWT ListBox Behavior
On 23 oct, 22:28, oks samko...@gmail.com wrote: I create a listbox with item 1, 11, 2, 22, and 3. I press 1, then the item with value 1 is selected. After 1 second, I press 2, then the item with value 2 is selected. If I press 2 immediately right after pressing 1, the item with value 2 is not selected. If I press 1 again immediately right after pressing 1, the item with value 11 is selected. Is this the right behavior? If yes, how can I get 2 when pressing 2 immediately right after pressing 1? It's just how your *browser* behaves; GWT doesn't do anything special with ListBox. --~--~-~--~~~---~--~~ 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: Data aware drop down widgets with MVP ?
On 25 oct, 01:56, fker...@gmail.com fker...@gmail.com wrote: Hi! Thinking about MVP... how would you implement a data aware drop down widget? Say you want to let the user enter a country code in the View. You could use a TextBox, but a drop down list would be more usable. How would the widget get its values? Should the Presenter know about the widget type, contact the server, get the countries data, and then feed the widget? Know about the widget type, in the sense of Java class, no, but knowing how it works (suggestbox) yes, definitely. However, I'm puzzled. I'm facing the same issue at work, and I was envisioning just injecting the SuggestOracle into the view (I'm using DI with GIN so it's pretty simple and easy); so effectively my presenter wouldn't be aware of the widget type; but this approach prevents the presenter from telling the view to show/hide a loading label/image (if that's how you do it otherwise) Doesn't that somehow violate the rule that you should be able to change the view without having to change the Presenter? Would you really change the view one day without changing the presenter? Try not to over-engineer (personnal rule of thumb). --~--~-~--~~~---~--~~ 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: Native JSON and safe parsing implementation
Great! stringify seems like it would make things even messier, but I guess (though I'd have to look) if JSON is natively supported then the browser vendor also has e.g. Date.prototype.toJSON() defined as well. I look forward to seeing your code! especially that last case. On Oct 25, 6:13 am, Thomas Broyer t.bro...@gmail.com wrote: On 23 oct, 22:55, Brendan bcke...@gmail.com wrote: I realize this post is coming at the end of the day on friday, but hopefully it will get a look =) Going through the different JSON parsing implementations available for GWT out there, almost all of them rely on a straight eval and note that they should only be used for trusted code. The old JSONValue code seems kind of quaint in light of JavaScriptObjects, and looking through the trunk it looks like there's just a TODO in JsonUtils for safe parsing. Funny! I'm finishing a JsonUtils patch (was about to submit it this night but finally chose to review it one more time, ensuring tests pass, checkstyle, etc.) adding: - JsonUtils.safeParse - JsonUtils.stringify - JsonUtils.isArray (equivalent of ECMAScript 5's Array.isArray) - deferred binding implementations using either native support (user.agent=ie8) or emulation (eval() for the parsing; user.agent= {ie6,gecko,opera}), and a fallback to emulation when native support isn't available (e.g. recent versions of Firefox, Chrome and Safari have native support, but older versions do not, so we detect if native JSON is supported –recent versions– and fallback to emulation otherwise –older versions–; user.agent={gecko1_8,safari}) I'm using a similar code at work with no problem so far. I'll ping when my patch is sent for review. --~--~-~--~~~---~--~~ 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: how to have app vary numbers of radio buttons?
have you run this in hosted mode? (or development mode) I don't see a public RadioButton arbys[] = new RadioButton[#]; anywhere so I would think you would be getting a NullPointerException when you try and do access the 0th element. On Oct 25, 12:35 am, Jon j...@rawbw.com wrote: The code: works fine when commented-out rb10 is active; when implemented as shown with array element, displays nothing: package com.wordsbythebay.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.RadioButton; /** * Entry point classes define codeonModuleLoad()/code. */ public class GrammarFun implements EntryPoint { /** * Create a remote service proxy to talk to the server-side Question service. */ private final QuestionServiceAsync questionService = GWT.create (QuestionService.class); public RadioButton rb11 = null; // public RadioButton rb10 = null; public RadioButton arbys[] = null; /** * This is the entry point method. */ public void onModuleLoad() { final RadioButton rb4 = new RadioButton(myGradioGroup2, goes); String[] myStringArray = {eat, eats}; final Question myQuestion = new Question(the boy, myStringArray, his lunch, s-v agreement); // add a flow panel to the root panel final FlowPanel panel = new FlowPanel(); // final ScrollPanel panel = new ScrollPanel(); RootPanel.get().add(panel); // Create a simple popup box for debugging final DialogBox dBox = new DialogBox(); dBox.setText(would get next question from server); dBox.setAnimationEnabled(true); final Button cB = new Button(Close); cB.getElement().setId(closeButton2); VerticalPanel dVP = new VerticalPanel(); dVP.addStyleName(dialogVPanel); dVP.add(new HTML(wadda wadda)); dVP.add(cB); dBox.setWidget(dVP); // Add a handler to close the DialogBox cB.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dBox.hide(); } }); // Create a handler for the radio button class MyRadHandler implements ClickHandler { int groupCount = 0; /** * Fired when the user clicks on the radio Button. */ public void onClick(ClickEvent event) { checkAnswer(); // if correct . . . // getNextQuestion(); } /** * check the user's answer */ void checkAnswer() { questionService.getQuestion(new AsyncCallbackQuestion() { public void onFailure(Throwable caught) { // might do better to just throw exception here dBox.setText(radio button error getting question from server); dBox.center(); cB.setFocus(true); } public void onSuccess(Question result) { // if (rb10 != null rb10.getValue() == true) if (arbys[0] != null arbys[0].getValue() == true)
Re: A strange setting for MVP
On Oct 25, 9:22 am, Thomas Broyer t.bro...@gmail.com wrote: I'd rather use the following, though I understand why the LoginView.Presenter interface could help with mocking (it's easier to mock the view then, because you don't have to mock HasClickHandlers and eventually HandlerRegistration and ClickEvent): LoginPresenter.View interface: String.getName() String getPass() HasClickHandlers getSignInButton() The LoginPresenter constructor looks like: LoginPresenter(LoginView view ...and some other parameters...) this.view = view; view.getSignInButton().addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { tryToLogin(); } }); Thanks for your feedback! I see yet another option, substituting a callback injection for the this injection: LoginPresenter.View interface: String getName( ); String getPass( ); AsyncCallbackObject setTryToLogin( ); then the constructor is: LoginPresenter(LoginView view ...and some other parameters...) this.view = view; AsyncCallbackObject callback = new AsyncCallbackObject ( ) { // onSuccess connect to the login service and try to login // we won't need onFailure } view.setTryToLogin(callback); and on clicking the Login button, the view would just execute callback.onSuccess(null); I'm wondering if that would be easier to mock... --~--~-~--~~~---~--~~ 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: EasyMock for GWT + MVP ?
On Oct 25, 9:11 am, lowecg2004 chris.lowe...@gmail.com wrote: Your error looks like you're using the EasyMock class extensions and are missing cglib jars from your build path. As it happens, I recently produced a getting started with MVP and unit testing with EasyMock article which might be of use: http://blog.hivedevelopment.co.uk/2009/10/introduction-to-mvp-unit-te... Hi! Thanks for the heads up -- however, I find a couple of details: * I added asm-3.1.jar and cglib-2.2.jar, which were in the GWT 2.0 tools/lib directory, but there was no asm-attrs.jar; do you still need it? * When running an empty JUnit (*not* GWTTestCase) test, which just does loginViewMock=createMock(LoginView.class) I get another exception... The GWT.create( ) problem -- how did you handle it? Or did I miss a step in your article? Thanks!! java.lang.ExceptionInInitializerError at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:619) at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:612) at net.sf.cglib.proxy.Enhancer.registerCallbacks(Enhancer.java:581) at org.easymock.classextension.internal.ClassProxyFactory.createProxy (ClassProxyFactory.java:108) at org.easymock.internal.MocksControl.createMock(MocksControl.java: 51) at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46) at com.fkereki.mvptest.client.LoginPresenterTest.testLoginPresenter1 (LoginPresenterTest.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall (FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run (ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively (FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate (InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create () is only usable in client code! It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor. at com.google.gwt.core.client.GWT.create(GWT.java:92) at com.google.gwt.user.client.ui.UIObject.clinit(UIObject.java:140) ... 35 more --~--~-~--~~~---~--~~ 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: Native JSON and safe parsing implementation
On 25 oct, 13:28, Brendan bcke...@gmail.com wrote: Great! stringify seems like it would make things even messier, but I guess (though I'd have to look) if JSON is natively supported then the browser vendor also has e.g. Date.prototype.toJSON() defined as well. I look forward to seeing your code! especially that last case. Patch sent for review at http://gwt-code-reviews.appspot.com/86803 stringify() is only implemented for JSOs (because application/json can only be an object or array; contrary to what JSON.stringify() accepts/ produces, per ECMAScript 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-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: JSNI method doesn't work in IE?
Well, if you use a flextable, you can add a clickhandler to the flextable, and in the handler do something like @Override public void onClick(ClickEvent event) { FlexTable source = (FlexTable)event.getSource(); // if you can't get to the original flextable Cell cellForEvent = source.getCellForEvent(event); int rowIndex = cellForEvent.getRowIndex(); } Ian http://examples.roughian.com 2009/10/25 Tomer tom...@gmail.com Ian, thanks for your reply. I'm trying to dynamically create a table and attach a mouseover handler to the table rows, instead of attaching it to the individual widgets. Any idea how I can do this with GWT, given the current situation with IE? Tomer On Oct 24, 2:54 pm, Ian Bambury ianbamb...@gmail.com wrote: Doesn't work in IE8 (or IE8 in IE7 mode) But i div in the html div onClick=run()/div will run it OK. IE has never run scripts you add dynamically AFAIR and looks like it isn't hooking up a handler here. Ian http://examples.roughian.com 2009/10/24 Tomer tom...@gmail.com Now also tested with GWT 2 M2. Not working in IE6, Don't know about the other IEs. On Oct 24, 10:42 am, Tomer tom...@gmail.com wrote: Yes, this is exactly what I expected. I'm using GWT 1.7.1 Following your response, I went over to WinXP (SP3), installed a fresh copy of eclipse and of the Google plugin, created a new GWT project and replaced the entire contents of the entry module class with the code listed above. Still doesn't work - when I click the label, nothing happens - not in hosted mode and not in web mode. (and still works in the other browsers) Regards, Tomer On Oct 24, 3:23 am, dougx douglas.lin...@gmail.com wrote: O_o can you be more specific? This works fine for me in ie6 / ie7 / ie8 / ie8 compatability mode... Well... which is to say, I got a popup saying Hello. What were you expecting to happen? public class Testing implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { runJSNI(); } private static native void runJSNI() /*-{ $wnd.run(); }-*/; private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } ~ D. On Oct 23, 11:38 pm, Tomer tom...@gmail.com wrote: Hi, I've got the following piece of code. Works perfectly in every browser other than IE. What's going on? package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; public class Iejsni implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { final Label label = new Label(click me); label.getElement().setAttribute(onclick, run()); RootPanel.get().add(label); } private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Bug? (GWT1.7 Linux SMP PAE)
1.5 runs on this platform is perfect. but 1.7 crashed --- T H R E A D --- Current thread (0x08f79000): JavaThread CompilerThread0 daemon [_thread_in_native, id=8994, stack(0x00879000,0x008fa000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x Registers: EAX=0x, EBX=0x011136e4, ECX=0x, EDX=0x ESP=0x008f7f00, EBP=0x008f7f68, ESI=0x0956f98c, EDI=0x0956f958 EIP=0x00c84f77, CR2=0x, EFLAGS=0x00210212 Top of Stack: (sp=0x008f7f00) 0x008f7f00: 9f06a864 0002 008f871c 008f871c 0x008f7f10: 0955fd90 000209a0 0a0d4b50 0001 0x008f7f20: 0100 004d 0a0d4b48 0009 0x008f7f30: 9f06a864 0001 0001 0x008f7f40: 08f0f3d0 001e 9b55ece0 0x008f7f50: 09a6a440 0002099c 0078 011136e4 0x008f7f60: 008f871c 06dd 008f80a8 00c86d11 0x008f7f70: 008f871c 0001 Instructions: (pc=0x00c84f77) 0x00c84f67: 8d 77 34 8b 02 52 ff 50 40 89 45 dc 89 c1 8b 16 0x00c84f77: 8b 00 21 c2 89 16 8b 56 04 8b 41 04 21 c2 89 56 Stack: [0x00879000,0x008fa000], sp=0x008f7f00, free space=507k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1c4f77] V [libjvm.so+0x1c6d11] V [libjvm.so+0x2185bb] V [libjvm.so+0x219a56] V [libjvm.so+0x1b4215] V [libjvm.so+0x21d9fb] V [libjvm.so+0x21e0e5] V [libjvm.so+0x563c38] V [libjvm.so+0x56b11c] V [libjvm.so+0x56b1f4] V [libjvm.so+0x4920e8] C [libpthread.so.0+0x550b] Current CompileTask: C2:541 org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.init (Lorg/eclipse/jdt/internal/compiler/lookup/ ParameterizedTypeBinding;Lorg/eclipse/jdt/internal/compiler/lookup/ MethodBinding;)V (596 bytes) --- P R O C E S S --- Java Threads: ( = current thread ) 0x0929d000 JavaThread Timer-1 daemon [_thread_blocked, id=9003, stack(0x051bb000,0x0520c000)] 0x09363000 JavaThread btpool0-1 - Acceptor0 selectchannelconnec...@0.0.0.0: [_thread_in_native, id=9002, stack (0x06ce7000,0x06d38000)] 0x09362c00 JavaThread btpool0-0 [_thread_blocked, id=9001, stack (0x04e7,0x04ec1000)] 0x09165000 JavaThread Timer-0 daemon [_thread_blocked, id=8999, stack(0x0507,0x050c1000)] 0x08f7dc00 JavaThread Low Memory Detector daemon [_thread_blocked, id=8996, stack(0x0097b000,0x009cc000)] 0x08f7bc00 JavaThread CompilerThread1 daemon [_thread_in_native, id=8995, stack(0x008fa000,0x0097b000)] =0x08f79000 JavaThread CompilerThread0 daemon [_thread_in_native, id=8994, stack(0x00879000,0x008fa000)] 0x08f77800 JavaThread Signal Dispatcher daemon [_thread_blocked, id=8993, stack(0x00828000,0x00879000)] 0x08f65c00 JavaThread Finalizer daemon [_thread_blocked, id=8992, stack(0x007d7000,0x00828000)] 0x08f61400 JavaThread Reference Handler daemon [_thread_blocked, id=8991, stack(0x00786000,0x007d7000)] 0x08ed3800 JavaThread main [_thread_in_Java, id=8984, stack (0x0013a000,0x0018b000)] Other Threads: 0x08f5dc00 VMThread [stack: 0x00705000,0x00786000] [id=8990] 0x08f7f800 WatcherThread [stack: 0x009cc000,0x00a4d000] [id=8997] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None --- S Y S T E M --- OS:Fedora release 8 (Werewolf) uname:Linux 2.6.23.1-42.fc8PAE #1 SMP Tue Oct 30 13:45:30 EDT 2007 i686 libc:glibc 2.7 NPTL 2.7 rlimit: STACK 10240k, CORE 0k, NPROC 81920, NOFILE 1024, AS infinity load average:5.05 4.24 3.83 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 4137496k(422356k free), swap 8940132k (8575900k free) vm_info: IcedTea Server VM (1.7.0-b21) for linux-x86 JRE (1.7.0-b21), built on Oct 15 2007 15:59:11 by kojibuilder with gcc 4.1.2 20070925 (Red Hat 4.1.2-31) time: Sun Oct 25 22:11:34 2009 elapsed time: 32 seconds --~--~-~--~~~---~--~~ 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: JSNI method doesn't work in IE?
Just notices that you want mouseover not click like the original question. I think you might be a bit stuck there unless you have fixed widths in which case you can use horizontalpanels in focuspanels in a verticalpanel. Ian http://examples.roughian.com 2009/10/25 Ian Bambury ianbamb...@gmail.com Well, if you use a flextable, you can add a clickhandler to the flextable, and in the handler do something like @Override public void onClick(ClickEvent event) { FlexTable source = (FlexTable)event.getSource(); // if you can't get to the original flextable Cell cellForEvent = source.getCellForEvent(event); int rowIndex = cellForEvent.getRowIndex(); } Ian http://examples.roughian.com 2009/10/25 Tomer tom...@gmail.com Ian, thanks for your reply. I'm trying to dynamically create a table and attach a mouseover handler to the table rows, instead of attaching it to the individual widgets. Any idea how I can do this with GWT, given the current situation with IE? Tomer On Oct 24, 2:54 pm, Ian Bambury ianbamb...@gmail.com wrote: Doesn't work in IE8 (or IE8 in IE7 mode) But i div in the html div onClick=run()/div will run it OK. IE has never run scripts you add dynamically AFAIR and looks like it isn't hooking up a handler here. Ian http://examples.roughian.com 2009/10/24 Tomer tom...@gmail.com Now also tested with GWT 2 M2. Not working in IE6, Don't know about the other IEs. On Oct 24, 10:42 am, Tomer tom...@gmail.com wrote: Yes, this is exactly what I expected. I'm using GWT 1.7.1 Following your response, I went over to WinXP (SP3), installed a fresh copy of eclipse and of the Google plugin, created a new GWT project and replaced the entire contents of the entry module class with the code listed above. Still doesn't work - when I click the label, nothing happens - not in hosted mode and not in web mode. (and still works in the other browsers) Regards, Tomer On Oct 24, 3:23 am, dougx douglas.lin...@gmail.com wrote: O_o can you be more specific? This works fine for me in ie6 / ie7 / ie8 / ie8 compatability mode... Well... which is to say, I got a popup saying Hello. What were you expecting to happen? public class Testing implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { runJSNI(); } private static native void runJSNI() /*-{ $wnd.run(); }-*/; private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } ~ D. On Oct 23, 11:38 pm, Tomer tom...@gmail.com wrote: Hi, I've got the following piece of code. Works perfectly in every browser other than IE. What's going on? package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; public class Iejsni implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { final Label label = new Label(click me); label.getElement().setAttribute(onclick, run()); RootPanel.get().add(label); } private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } --~--~-~--~~~---~--~~ 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: JSNI method doesn't work in IE?
Hi Ian, I can actually suggest an acceptable solution here, based on inheritance: private static class MyFlexTable extends FlexTable implements HasMouseOverHandlers, HasMouseOutHandlers { public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) { return addDomHandler(handler, MouseOverEvent.getType()); } public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) { return addDomHandler(handler, MouseOutEvent.getType()); } public Cell getCellForNativeEvent(NativeEvent event) { Element td = getEventTargetCell(Event.as(event)); if (td == null) { return null; } Element tr = DOM.getParent(td); Element body = DOM.getParent(tr); int row = DOM.getChildIndex(body, tr); int column = DOM.getChildIndex(tr, td); return new MyCell(row, column); } private class MyCell extends Cell { protected MyCell(int rowIndex, int cellIndex) { super(rowIndex, cellIndex); } } } and you just use the getCellForNativeEvent instead of getCellForEvent. (passing in event.getNativeEvent() as a parameter) I've submitted an enhancement request on the GWT issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=4165 Thanks, Tomer On Oct 25, 4:34 pm, Ian Bambury ianbamb...@gmail.com wrote: Just notices that you want mouseover not click like the original question. I think you might be a bit stuck there unless you have fixed widths in which case you can use horizontalpanels in focuspanels in a verticalpanel. Ian http://examples.roughian.com 2009/10/25 Ian Bambury ianbamb...@gmail.com Well, if you use a flextable, you can add a clickhandler to the flextable, and in the handler do something like @Override public void onClick(ClickEvent event) { FlexTable source = (FlexTable)event.getSource(); // if you can't get to the original flextable Cell cellForEvent = source.getCellForEvent(event); int rowIndex = cellForEvent.getRowIndex(); } Ian http://examples.roughian.com 2009/10/25 Tomer tom...@gmail.com Ian, thanks for your reply. I'm trying to dynamically create a table and attach a mouseover handler to the table rows, instead of attaching it to the individual widgets. Any idea how I can do this with GWT, given the current situation with IE? Tomer On Oct 24, 2:54 pm, Ian Bambury ianbamb...@gmail.com wrote: Doesn't work in IE8 (or IE8 in IE7 mode) But i div in the html div onClick=run()/div will run it OK. IE has never run scripts you add dynamically AFAIR and looks like it isn't hooking up a handler here. Ian http://examples.roughian.com 2009/10/24 Tomer tom...@gmail.com Now also tested with GWT 2 M2. Not working in IE6, Don't know about the other IEs. On Oct 24, 10:42 am, Tomer tom...@gmail.com wrote: Yes, this is exactly what I expected. I'm using GWT 1.7.1 Following your response, I went over to WinXP (SP3), installed a fresh copy of eclipse and of the Google plugin, created a new GWT project and replaced the entire contents of the entry module class with the code listed above. Still doesn't work - when I click the label, nothing happens - not in hosted mode and not in web mode. (and still works in the other browsers) Regards, Tomer On Oct 24, 3:23 am, dougx douglas.lin...@gmail.com wrote: O_o can you be more specific? This works fine for me in ie6 / ie7 / ie8 / ie8 compatability mode... Well... which is to say, I got a popup saying Hello. What were you expecting to happen? public class Testing implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { runJSNI(); } private static native void runJSNI() /*-{ $wnd.run(); }-*/; private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } ~ D. On Oct 23, 11:38 pm, Tomer tom...@gmail.com wrote: Hi, I've got the following piece of code. Works perfectly in every browser other than IE. What's going on? package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; public class Iejsni implements EntryPoint {
Re: Displaying static content on gwt client
Thanks for the reply. So it means that it is going to be a GET request from the client to the server for the resource once the client will load on the browser. I am thinking to place most of the design code [html] in the static files with .html and place their contents into the panel's setHtml() instead of writing GWT code for every thing. like for example I have a panel in the top that contains anchors like Home, Support, News etc. Instead of creating a Hyperlink object for each link and setting the style element to format it, I am thinking to read this chunk of code from a html file [now use RequestBuilder] and use the panels's setHtml (String) to display it. The benefit I can see with this approach is avoid compiling the code even for a small change and also it could be easy to change in the future. Am I thinking in the right direction? On Oct 25, 3:33 am, Sripathi Krishnan sripathi.krish...@gmail.com wrote: Instead of using java.io.* packages, you can use GWTs RequestBuilder class to achieve the same thing. Only restriction - the static content should be served from the same domain as your web application. RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url /*must be in same domain as your web app*/); try { request.sendRequest(null, new RequestCallback() { public void onResponseReceived(Request request, Response response) { String content = response.getText(); if (response.getStatusCode() != 200) { //handle error } else if (content == null || content.equals()) { //handle error } else { setStaticContentInHtmlPanel(content); } } public void onError(Request request, Throwable exception) { // handle error } }); } catch (RequestException re) { //handle error } --Sri 2009/10/24 usmanf linkusma...@yahoo.com I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like Panel panel = new Panel(); panel.setHtml(pNews/pp news news nes newsnsnwensd nsdnewes/ p); I have got a lot of static content to display on the home page which is quite annoying to place in the String. Is there any other way/ solution around. 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 -~--~~~~--~~--~--~---
Re: Bug? (GWT1.7 Linux SMP PAE)
Changed a VM,it's ok now. On Oct 25, 10:20 pm, Math2Gold math2g...@gmail.com wrote: 1.5 runs on this platform is perfect. but 1.7 crashed --- T H R E A D --- Current thread (0x08f79000): JavaThread CompilerThread0 daemon [_thread_in_native, id=8994, stack(0x00879000,0x008fa000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x Registers: EAX=0x, EBX=0x011136e4, ECX=0x, EDX=0x ESP=0x008f7f00, EBP=0x008f7f68, ESI=0x0956f98c, EDI=0x0956f958 EIP=0x00c84f77, CR2=0x, EFLAGS=0x00210212 Top of Stack: (sp=0x008f7f00) 0x008f7f00: 9f06a864 0002 008f871c 008f871c 0x008f7f10: 0955fd90 000209a0 0a0d4b50 0001 0x008f7f20: 0100 004d 0a0d4b48 0009 0x008f7f30: 9f06a864 0001 0001 0x008f7f40: 08f0f3d0 001e 9b55ece0 0x008f7f50: 09a6a440 0002099c 0078 011136e4 0x008f7f60: 008f871c 06dd 008f80a8 00c86d11 0x008f7f70: 008f871c 0001 Instructions: (pc=0x00c84f77) 0x00c84f67: 8d 77 34 8b 02 52 ff 50 40 89 45 dc 89 c1 8b 16 0x00c84f77: 8b 00 21 c2 89 16 8b 56 04 8b 41 04 21 c2 89 56 Stack: [0x00879000,0x008fa000], sp=0x008f7f00, free space=507k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1c4f77] V [libjvm.so+0x1c6d11] V [libjvm.so+0x2185bb] V [libjvm.so+0x219a56] V [libjvm.so+0x1b4215] V [libjvm.so+0x21d9fb] V [libjvm.so+0x21e0e5] V [libjvm.so+0x563c38] V [libjvm.so+0x56b11c] V [libjvm.so+0x56b1f4] V [libjvm.so+0x4920e8] C [libpthread.so.0+0x550b] Current CompileTask: C2:541 org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.init (Lorg/eclipse/jdt/internal/compiler/lookup/ ParameterizedTypeBinding;Lorg/eclipse/jdt/internal/compiler/lookup/ MethodBinding;)V (596 bytes) --- P R O C E S S --- Java Threads: ( = current thread ) 0x0929d000 JavaThread Timer-1 daemon [_thread_blocked, id=9003, stack(0x051bb000,0x0520c000)] 0x09363000 JavaThread btpool0-1 - Acceptor0 selectchannelconnec...@0.0.0.0: [_thread_in_native, id=9002, stack (0x06ce7000,0x06d38000)] 0x09362c00 JavaThread btpool0-0 [_thread_blocked, id=9001, stack (0x04e7,0x04ec1000)] 0x09165000 JavaThread Timer-0 daemon [_thread_blocked, id=8999, stack(0x0507,0x050c1000)] 0x08f7dc00 JavaThread Low Memory Detector daemon [_thread_blocked, id=8996, stack(0x0097b000,0x009cc000)] 0x08f7bc00 JavaThread CompilerThread1 daemon [_thread_in_native, id=8995, stack(0x008fa000,0x0097b000)] =0x08f79000 JavaThread CompilerThread0 daemon [_thread_in_native, id=8994, stack(0x00879000,0x008fa000)] 0x08f77800 JavaThread Signal Dispatcher daemon [_thread_blocked, id=8993, stack(0x00828000,0x00879000)] 0x08f65c00 JavaThread Finalizer daemon [_thread_blocked, id=8992, stack(0x007d7000,0x00828000)] 0x08f61400 JavaThread Reference Handler daemon [_thread_blocked, id=8991, stack(0x00786000,0x007d7000)] 0x08ed3800 JavaThread main [_thread_in_Java, id=8984, stack (0x0013a000,0x0018b000)] Other Threads: 0x08f5dc00 VMThread [stack: 0x00705000,0x00786000] [id=8990] 0x08f7f800 WatcherThread [stack: 0x009cc000,0x00a4d000] [id=8997] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None --- S Y S T E M --- OS:Fedora release 8 (Werewolf) uname:Linux 2.6.23.1-42.fc8PAE #1 SMP Tue Oct 30 13:45:30 EDT 2007 i686 libc:glibc 2.7 NPTL 2.7 rlimit: STACK 10240k, CORE 0k, NPROC 81920, NOFILE 1024, AS infinity load average:5.05 4.24 3.83 CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 4137496k(422356k free), swap 8940132k (8575900k free) vm_info: IcedTea Server VM (1.7.0-b21) for linux-x86 JRE (1.7.0-b21), built on Oct 15 2007 15:59:11 by kojibuilder with gcc 4.1.2 20070925 (Red Hat 4.1.2-31) time: Sun Oct 25 22:11:34 2009 elapsed time: 32 seconds --~--~-~--~~~---~--~~ 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: JSNI method doesn't work in IE?
It's also possible to extend FlexTable with a HasMouseOverHandlers, HasMouseOutHandlers and HasMouseMoveHandlers, and copy what GWT does for onClick. However, you will have to do a lot of manual labour in onMouseMove. On Oct 25, 4:34 pm, Ian Bambury ianbamb...@gmail.com wrote: Just notices that you want mouseover not click like the original question. I think you might be a bit stuck there unless you have fixed widths in which case you can use horizontalpanels in focuspanels in a verticalpanel. Ian http://examples.roughian.com 2009/10/25 Ian Bambury ianbamb...@gmail.com Well, if you use a flextable, you can add a clickhandler to the flextable, and in the handler do something like @Override public void onClick(ClickEvent event) { FlexTable source = (FlexTable)event.getSource(); // if you can't get to the original flextable Cell cellForEvent = source.getCellForEvent(event); int rowIndex = cellForEvent.getRowIndex(); } Ian http://examples.roughian.com 2009/10/25 Tomer tom...@gmail.com Ian, thanks for your reply. I'm trying to dynamically create a table and attach a mouseover handler to the table rows, instead of attaching it to the individual widgets. Any idea how I can do this with GWT, given the current situation with IE? Tomer On Oct 24, 2:54 pm, Ian Bambury ianbamb...@gmail.com wrote: Doesn't work in IE8 (or IE8 in IE7 mode) But i div in the html div onClick=run()/div will run it OK. IE has never run scripts you add dynamically AFAIR and looks like it isn't hooking up a handler here. Ian http://examples.roughian.com 2009/10/24 Tomer tom...@gmail.com Now also tested with GWT 2 M2. Not working in IE6, Don't know about the other IEs. On Oct 24, 10:42 am, Tomer tom...@gmail.com wrote: Yes, this is exactly what I expected. I'm using GWT 1.7.1 Following your response, I went over to WinXP (SP3), installed a fresh copy of eclipse and of the Google plugin, created a new GWT project and replaced the entire contents of the entry module class with the code listed above. Still doesn't work - when I click the label, nothing happens - not in hosted mode and not in web mode. (and still works in the other browsers) Regards, Tomer On Oct 24, 3:23 am, dougx douglas.lin...@gmail.com wrote: O_o can you be more specific? This works fine for me in ie6 / ie7 / ie8 / ie8 compatability mode... Well... which is to say, I got a popup saying Hello. What were you expecting to happen? public class Testing implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { runJSNI(); } private static native void runJSNI() /*-{ $wnd.run(); }-*/; private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } ~ D. On Oct 23, 11:38 pm, Tomer tom...@gmail.com wrote: Hi, I've got the following piece of code. Works perfectly in every browser other than IE. What's going on? package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; public class Iejsni implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { final Label label = new Label(click me); label.getElement().setAttribute(onclick, run()); RootPanel.get().add(label); } private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } --~--~-~--~~~---~--~~ 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: how to send variables in form panel
So in any way you will send multipart message to the server. The multipart message have same structure like normal message request. Have header and body. The key difference is the body structure. The body contain more then one message in his structure. Example: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=frontier This is a message with multiple parts in MIME format. --frontier Content-Type: text/plain This is the body of the message. --frontier Content-Type: application/octet-stream Content-Transfer-Encoding: base64 PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg== --frontier-- So you need to parse this message to get the data out of the body. I post you one example before how to parse multipart message. You can access the parameters like this httpRequest.getParameter(warehouse). If its null you probably don't send it correctly. Use firebug to see the traffic between client and server. On Fri, Oct 23, 2009 at 6:19 PM, YoeZ juz...@gmail.com wrote: yes, of course I put the multipart in client code: form.setAction(GWT.getModuleBaseURL() + uploadfileservlet); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); I have a form with uploadfile widget, and some textbox. the uploaded file was successfully sent to server,, but the textbox item is null return in servlet. is there any other way to uploadfile with some field (texboxes)? instead of using formpanel? On Oct 23, 12:20 pm, QBox qbox2...@gmail.com wrote: Sohttp://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g. .. http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g.. . Class FormPanel A panel that wraps its contents in an HTML FORM element. YoeZ say that he use This panel so it will be multipart ;) On Thu, Oct 22, 2009 at 8:57 PM, Sudeep S sudee...@gmail.com wrote: multipart requests have to be sent via a FORM panel On Thu, Oct 22, 2009 at 6:53 PM, Lazo Apostolovski qbox2...@gmail.com wrote: Its probably a multipart message :S Try googling for how to accept multipart message on the server side here is some example but i don't know if you find usefull. public HashMapString, InputStream parseMultipartMessage( HttpServletRequest request) { mapWithStreams = new HashMapString, InputStream(); boolean isMultipart = ServletFileUpload.isMultipartContent(request); try { if (isMultipart) { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); ListFileItem items = upload.parseRequest(request); for (FileItem item : items) { mapWithStreams.put(item.getFieldName(), item.getInputStream()); } } else { mapWithStreams.put(DEFAULT_KEY, request.getInputStream()); } } catch (FileUploadException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return mapWithStreams; In normal message (not multipart) data from the text fields come like the body of the message. If you try to transfer file in normal message then Stream is send like the body of the message. So you can transver only Parameters or only stream. If you want to transfer parameters and stream in same message you need to use multipart message. In multipart message InputStream come on server like a body of the message. If that input stream contain multipart message you need to parse that message. So in one part you will have values from input fields and in other part you will have Stream for uploaded file. Read about multipart messages on the wiki site. Code abowe will parse all input streams from multipart message and place them to the HasMap. The Key in HashMap is the File name. You can access to streams later when you need them. To the parameters you can access on the same way like you deed before: request.getParameter(parameterName); Good luck. YoeZ wrote: Hey abhiram, I still have a problem in server side,, can you tell me how to catch variable from client. Let say I have a textbox in client. Textbox txtComment = new Textbox; txtComment.setName(txtComment); txtComment .setText(hello); in server side: I've tried: String varXXX = (String) request.getParameter(txtComment); but that's not working. :( and I've also tried like this : try { List items = upload.parseRequest(request); Iterator it = items.iterator(); while (it.hasNext()) { FileItem item = (FileItem) it.next(); if (item.isFormField()) { String name = item.getFieldName(); if
GWT.log listener in hosted mode
Hello, I am looking for some help. I want to be able to listen to the GWT.log messages that are output in the hosted mode console and use them in another application. Currently I am only interested in doing this locally. My thoughts are that the simplest way to achieve this is to some how write them to a file? Does anyone know how to do this? Ideally there would be a way that I can do this would modifying the GWT code base. Any help/ advice would be great. Thanks, Alan. --~--~-~--~~~---~--~~ 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: EasyMock for GWT + MVP ?
It's possible to use EasyMock to mock out GWT widgets in a standard JUnit or TestNG test, but you need to use GWTMockUtilities to disarm GWT. -- Arthur Kalmenson On Sun, Oct 25, 2009 at 12:58 AM, fker...@gmail.com fker...@gmail.com wrote: I remember EasyMock didn't work for GWT, because it needed reflection, which wasn't available for client side programming. However, I'm doing MVP tests, so the code need not run in hosted mode, so EasyMode should run... right? However, I'm getting the following error -- can somebody point me in the right direction? java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer at org.easymock.classextension.internal.MocksClassControl.createProxyFactory (MocksClassControl.java:78) at org.easymock.internal.MocksControl.createMock(MocksControl.java: 50) at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46) at com.fkereki.mvptest.client.LoginPresenterTest.setUp (LoginPresenterTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall (FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run (ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively (FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336) ... 27 more --~--~-~--~~~---~--~~ 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: EasyMock for GWT + MVP ?
As Arthur said, calling GWTMockUtilities.disarm() will prevent that error (that was in part 2 of my article :) As for needing asm-attrs.jar, I guess try it - any NoClassDefFoundError that looks asm related then that will answer your question... Cheers, Chris. On Oct 25, 5:44 pm, Arthur Kalmenson arthur.k...@gmail.com wrote: It's possible to use EasyMock to mock out GWT widgets in a standard JUnit or TestNG test, but you need to use GWTMockUtilities to disarm GWT. -- Arthur Kalmenson On Sun, Oct 25, 2009 at 12:58 AM, fker...@gmail.com fker...@gmail.com wrote: I remember EasyMock didn't work for GWT, because it needed reflection, which wasn't available for client side programming. However, I'm doing MVP tests, so the code need not run in hosted mode, so EasyMode should run... right? However, I'm getting the following error -- can somebody point me in the right direction? java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer at org.easymock.classextension.internal.MocksClassControl.createProxyFactory (MocksClassControl.java:78) at org.easymock.internal.MocksControl.createMock(MocksControl.java: 50) at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46) at com.fkereki.mvptest.client.LoginPresenterTest.setUp (LoginPresenterTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall (FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run (ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively (FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate (RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336) ... 27 more --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
OOPHM - another port
Hello! I want to run two apps in OOPHM simultaneously (one is main site, and other is admin editor) How can I change OOPHM bind port 9997 ? Currently I see [ERROR] Unable to bind socket on port 9997 -- is another session active? when running second app. 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 -~--~~~~--~~--~--~---
Liferay and GWT integration issue
Hi, I'm trying to launch some hello world example using GWT and Liferay (Portlet container). I decided to use Liferay Bundled with Tomcat 6.0. Here are the details of solution I want to implement: 1. I'd like to attach code generated by GWT only once for the whole portal. I figured it out that I can include common js code which can be accessed by all portlets by creating portlet-ext.properties in which I can attach extra js files by editing property javascript.everything.files. I did so, newly created configuration file is being loaded and attached js code has been launched. 2. I deployed two independent portlets which can call simple JS functions implemented in previously attached file. Till now everything works fine and my next step is to attach gwt generated js file. I copy all files generated by gwt to directory in which there are all external js files, that is html/js. In my configuration file I add gwt bootstrap file called gwttestproject.nocache.js. Then when I reload application portal nothing special happens. I tried to manually run the function gwttestproject implemented in gwt bootstrap script and then whole page disappers. Probably it's because bootstrap script I've mentioned about uses document.write() method which causes whole document is being removed. I've read, but I don't remember exactly where, that in future version of GWT Google folks are going to change bootstrap script implentation to aviod this kind of problem. I downloaded GWT 2.0.0-ms2 but bootstrap didn't change. Anyway, if you have any experience with integrating Liferay and GWT, It would be great if you could drop here a line about your hacking :) Best regards, Janusz Prokulewicz --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RunAsyncCallback
I'm trying to split my code using sort of proxies, where I reuse parametrized RunAsyncCallback class. This class has basically just reference to Gin Provider of the real module class. When I use this for loading one module, it works perfectly, and I'm getting nice and correct location of split point in report. When I use this second time, loading different module proxy which uses the same RunAsyncCallback class, both split points happen to be in Leftovers code. Yet, split point on my proxies are still listed in report, but with the same minimal (386) size. I tried to use inline implementation of RunAsyncCallback instead, and surprise! Split points worked correctly again. Here is my parametrized RunAsyncCallback class: class AsyncLoader implements RunAsyncCallback { private ProjectPresenter parent; private PlaceManager placeManager; private Provider? extends AbstractLabeledPresenter real; AsyncLoader( ProjectPresenter parent, Provider? extends AbstractLabeledPresenter real, PlaceManager placeManager ) { this.placeManager = placeManager; this.parent = parent; this.real = real; } @Override public void onFailure(Throwable reason) { // TODO Auto-generated method stub } @Override public void onSuccess() { AbstractLabeledPresenter mod = real.get(); parent.addModule( mod ); if ( mod.hasToken( History.getToken() ) ) { mod.revealDisplay(); parent.show(mod); placeManager.fireCurrentPlace(); } } } This is inner class defined in AbstractLabeledPresenter, that's the same one I'm proxying and loading with GWT.runAsync. @Inject annotation is not present because injection is done on proxy class which in turn instatiates AbstractLabeledPresenter$AsyncLoader. Not sure whether this is bug, but I can't see any linking or any other rason why that code should end up in Leftovers and have empty, zero size split points. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ListBox and listeners.
I have a issue that I'm trying to resolve and it may be something simple that I'm completely overlooking. I have a ListBox that has a ChangeHandler registered with it. I would like to programatically change the value of the ListBox and have an event fired that I can listen for. Unfortunately programatically changing the value does not fire an event to the ChangeHandler. While searching the internet I only came across disturbingly unelegant solutions to this problem (which I'm also convinced will not resolve the problem). I also have several TextBox objects that I can simply call setValue(some string, true) to fire an event to a ValueChangeHandler. The ListBox does not have a corresponding mechanism to fire an event. If anyone has any suggestions on how to tackle this problem, that would be greatly appreciated. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
java.lang.NoClassDefFoundError:java.net.Socket
hi everyone. i am new to GWT,when i connect to oracle database from my application,i geting following error java.lang.NoClassDefFoundError:java.net.Socket is a restricted class.plz guide me to solve this problem. thanks balu --~--~-~--~~~---~--~~ 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: How to read POST parameters in GWT
I'm fairly new to GWT as well and was trying to solve the same problem. I know you can pull out 'GET' parameters using a call like this: Window.Location.getParameter(token); Don't know if that is an option you can use. Jett On Oct 9, 2:55 pm, Sudeep S sudee...@gmail.com wrote: Hi, I am new to gwt. I am invoking a gwt module from an external html and passing parameters in the POST. How can they be retrieved in the gwt app. Thanks Sudeep --~--~-~--~~~---~--~~ 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: OOPHM - another port
On 25 oct, 20:31, Andrey mino...@gmail.com wrote: Hello! I want to run two apps in OOPHM simultaneously (one is main site, and other is admin editor) How can I change OOPHM bind port 9997 ? See http://groups.google.fr/group/google-web-toolkit/msg/6b96afcd35f4244b --~--~-~--~~~---~--~~ 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: EasyMock for GWT + MVP ?
On 25 oct, 14:32, fker...@gmail.com fker...@gmail.com wrote: On Oct 25, 9:11 am, lowecg2004 chris.lowe...@gmail.com wrote: Your error looks like you're using the EasyMock class extensions and are missing cglib jars from your build path. As it happens, I recently produced a getting started with MVP and unit testing with EasyMock article which might be of use: http://blog.hivedevelopment.co.uk/2009/10/introduction-to-mvp-unit-te... Hi! Thanks for the heads up -- however, I find a couple of details: * I added asm-3.1.jar and cglib-2.2.jar, which were in the GWT 2.0 tools/lib directory, but there was no asm-attrs.jar; do you still need it? * When running an empty JUnit (*not* GWTTestCase) test, which just does loginViewMock=createMock(LoginView.class) I get another exception... The GWT.create( ) problem -- how did you handle it? Or did I miss a step in your article? You'd generally mock your LoginPresenter.Display interface (or however you called it, your probably have one; otherwise, here is when it is useful to have one ;-) ), not your LoginView, which uses widgets, which need GWTMockUtilities (but it does not always work: History for instance cannot be used in pure Java, even with GWTMockUtilities.disarm()). --~--~-~--~~~---~--~~ 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: ListBox and listeners.
On 25 oct, 17:40, Emerson Matsuuchi ema...@gmail.com wrote: I have a issue that I'm trying to resolve and it may be something simple that I'm completely overlooking. I have a ListBox that has a ChangeHandler registered with it. I would like to programatically change the value of the ListBox and have an event fired that I can listen for. Unfortunately programatically changing the value does not fire an event to the ChangeHandler. While searching the internet I only came across disturbingly unelegant solutions to this problem (which I'm also convinced will not resolve the problem). I also have several TextBox objects that I can simply call setValue(some string, true) to fire an event to a ValueChangeHandler. The ListBox does not have a corresponding mechanism to fire an event. If anyone has any suggestions on how to tackle this problem, that would be greatly appreciated. Because a ChangeEvent is a DomEvent, it's a bit less easy to fire one than a ValueChangeEvent. Try this: DomEvent.fireNativeEvent(Document.get().createChangeEvent(), myListBox); ...or implement an HasValue or HasValueChangeHandlers wrapping your ListBox (you can use HasValueString, HasValueInteger, HasValueString[] or HasValueInteger[], that's why ListBox doesn't itself implement HasValue) --~--~-~--~~~---~--~~ 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: ListBox and listeners.
The way I would do it is just to make a method out of what you call in your ListBox ChangeHandler then call that method anytime you set the value of the ListBox. Though depending on how complicated the page is or how many list boxes you have that could be a little tricky. On Oct 25, 7:52 pm, Thomas Broyer t.bro...@gmail.com wrote: On 25 oct, 17:40, Emerson Matsuuchi ema...@gmail.com wrote: I have a issue that I'm trying to resolve and it may be something simple that I'm completely overlooking. I have a ListBox that has a ChangeHandler registered with it. I would like to programatically change the value of the ListBox and have an event fired that I can listen for. Unfortunately programatically changing the value does not fire an event to the ChangeHandler. While searching the internet I only came across disturbingly unelegant solutions to this problem (which I'm also convinced will not resolve the problem). I also have several TextBox objects that I can simply call setValue(some string, true) to fire an event to a ValueChangeHandler. The ListBox does not have a corresponding mechanism to fire an event. If anyone has any suggestions on how to tackle this problem, that would be greatly appreciated. Because a ChangeEvent is a DomEvent, it's a bit less easy to fire one than a ValueChangeEvent. Try this: DomEvent.fireNativeEvent(Document.get().createChangeEvent(), myListBox); ...or implement an HasValue or HasValueChangeHandlers wrapping your ListBox (you can use HasValueString, HasValueInteger, HasValueString[] or HasValueInteger[], that's why ListBox doesn't itself implement HasValue) --~--~-~--~~~---~--~~ 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: Will RequestBuilder in upcoming 2.0 support PUT and DELETE?
Thanks! On 10月25日, 下午7时15分, Thomas Broyer t.bro...@gmail.com wrote: On 25 oct, 09:47, Fangzx fangzhoux...@gmail.com wrote: I want to call server side RESTful service by RequestBuilder, but it currently only support GET and POST, any plan to support PUT and DELETE in upcoming 2.0? Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3388 (with workaround and patch) --~--~-~--~~~---~--~~ 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: Organizing multiple HTML hosts / Entry points, etc. in single webapp
This is the same question what I want to ask also. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I can't find the Compile/Browse button in GWT 2.0-ms2
In GWT version 1.x, I can press the Compile/Browse in hosted mode console to compile, but I can't find the Compile/Browse button in GWT 2.0-ms2. --~--~-~--~~~---~--~~ 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: java.lang.NoClassDefFoundError:java.net.Socket
- You cannot connect to database from client side code. - In your server side code, you can connect to databases - however - if you are also using Google App Engine, you cannot. You are perhaps using Google App Engine along with Google Web Toolkit. Disable App Engine, and things should run okay. --Sri 2009/10/25 balu balakrishn...@gmail.com hi everyone. i am new to GWT,when i connect to oracle database from my application,i geting following error java.lang.NoClassDefFoundError:java.net.Socket is a restricted class.plz guide me to solve this problem. thanks balu --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Uploading my war to the Server
I have finished building my first sort of complex app using GWT I connect to a MySQL DB using my JDBC connector and everything. Now I have one last issue, why can't I use the app when I deploy it on my server? I have to login and using Firebug I see that I get: Firebug's log limit has been reached. %S entries not shown. Preferences POST http://www.expressiondance.com.mx/C/votaciones/67.212.170.186/MySQLConnection POST http://www.expressiondance.com.mx/C/votaciones/67.212.170.186/MySQLConnection 404 Not Found !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN HTMLHEAD TITLE404 Not Found/TITLE /HEADBODY H1Not Found/H1 The requested URL /C/votaciones/MySQLConnection was not found on this server. HR /BODY/HTML I see that it's not finding that file but I can't figure out why since locally it works perfectly =S help please as this is sort of urgent =/ --~--~-~--~~~---~--~~ 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: JSNI method doesn't work in IE?
Hm. IE doesn't support setAttribute to set event listeners, and GWT prides itself on not accommodating different browsers for things like this, You're best off writing your own. Perhaps something like this? public void onModuleLoad() { final Label l = new Label(This is a label); setProperty(l.getElement(),onclick, alert('hello');); RootPanel.get().add(l); } private native void setProperty(Element e, String property, String value) /*-{ var event = null; value = event = function() { + value + };; eval(value); e[property] = event; }-*/; ~ D. On Oct 24, 4:42 pm, Tomer tom...@gmail.com wrote: Yes, this is exactly what I expected. I'm using GWT 1.7.1 Following your response, I went over to WinXP (SP3), installed a fresh copy of eclipse and of the Google plugin, created a new GWT project and replaced the entire contents of the entry module class with the code listed above. Still doesn't work - when I click the label, nothing happens - not in hosted mode and not in web mode. (and still works in the other browsers) Regards, Tomer On Oct 24, 3:23 am, dougx douglas.lin...@gmail.com wrote: O_o can you be more specific? This works fine for me in ie6 / ie7 / ie8 / ie8 compatability mode... Well... which is to say, I got a popup saying Hello. What were you expecting to happen? public class Testing implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { runJSNI(); } private static native void runJSNI() /*-{ $wnd.run(); }-*/; private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } ~ D. On Oct 23, 11:38 pm, Tomer tom...@gmail.com wrote: Hi, I've got the following piece of code. Works perfectly in every browser other than IE. What's going on? package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; public class Iejsni implements EntryPoint { static { exportJSNI(); } public void onModuleLoad() { final Label label = new Label(click me); label.getElement().setAttribute(onclick, run()); RootPanel.get().add(label); } private static native void exportJSNI() /*-{ $wnd.run = function() { alert(hello); }; }-*/; } --~--~-~--~~~---~--~~ 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: HashMap Serialization Errors - GWT 1.7.0/1.7.1
I am also having the same problem and I have been struggling for the last two days. On Oct 19, 11:53 am, Doug In SC dougjwh...@gmail.com wrote: The Windows version of the GWT fails whenever aHashMapis used in an object that implements the IsSerializable interface. An IllegalArgumentException is thrown from the ServerSerializationStreamWriter. If the GWT source code is downloaded and built the problem does not occur however I would prefer to use the official version of the jar files. Has this problem been reported and/or fixed in a later release? --~--~-~--~~~---~--~~ 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: RunAsyncCallback
Maybe somebody from google will confirm this, but I doubt you are going to achieve code splitting by using proxies or interfaces, or by using any generic parameterized approach. A piece of code will end up in split-point-1.js *only if* it is always being used from within GWT.runAsync(). If a class can be used from two separate GWT.runAsync() method blocks, it is going to end up in the left-overs block. Now here is my understanding of the situation (of course I may be wrong) - - You have two instances of the class AsyncLoader, say LoaderA and LoaderB, with two unique providers - say ProviderA and ProviderB - GWTC recognizes that there will be two GWT.runAsync() blocks, which is why it creates two split points - But it cannot guarantee that LoaderA will always get ProviderA, and so it should put the code for ProviderA in split-point1.js - So, it knows that the entry point is not using ProviderA or ProviderB - which is why it is not in the initial download fragment. But it cannot guarantee it will always be used from a unique code fragment, which is why it ends up in the left-over fragment. - When you use the inline implementation, you will hard-code the actual provider - and hence things will work. The only pattern that works well is Googles recommended Async Package Patter. See this presentationhttp://dl.google.com/io/2009/pres/Th_1045_TheStoryofyourCompile-ReadingtheTeaLeavesoftheGWTCompilerforanOptimizedFuture.pdf. --Sri 2009/10/25 skrat dusan.malia...@gmail.com I'm trying to split my code using sort of proxies, where I reuse parametrized RunAsyncCallback class. This class has basically just reference to Gin Provider of the real module class. When I use this for loading one module, it works perfectly, and I'm getting nice and correct location of split point in report. When I use this second time, loading different module proxy which uses the same RunAsyncCallback class, both split points happen to be in Leftovers code. Yet, split point on my proxies are still listed in report, but with the same minimal (386) size. I tried to use inline implementation of RunAsyncCallback instead, and surprise! Split points worked correctly again. Here is my parametrized RunAsyncCallback class: class AsyncLoader implements RunAsyncCallback { private ProjectPresenter parent; private PlaceManager placeManager; private Provider? extends AbstractLabeledPresenter real; AsyncLoader( ProjectPresenter parent, Provider? extends AbstractLabeledPresenter real, PlaceManager placeManager ) { this.placeManager = placeManager; this.parent = parent; this.real = real; } @Override public void onFailure(Throwable reason) { // TODO Auto-generated method stub } @Override public void onSuccess() { AbstractLabeledPresenter mod = real.get(); parent.addModule( mod ); if ( mod.hasToken( History.getToken() ) ) { mod.revealDisplay(); parent.show(mod); placeManager.fireCurrentPlace(); } } } This is inner class defined in AbstractLabeledPresenter, that's the same one I'm proxying and loading with GWT.runAsync. @Inject annotation is not present because injection is done on proxy class which in turn instatiates AbstractLabeledPresenter$AsyncLoader. Not sure whether this is bug, but I can't see any linking or any other rason why that code should end up in Leftovers and have empty, zero size split points. --~--~-~--~~~---~--~~ 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: RunAsyncCallback
Also, this paragraph from Code Splitting wikihttp://code.google.com/p/google-web-toolkit/wiki/CodeSplittingmay be useful - A less common example is that you expected an item to be exclusive to some split point, but actually it's only included in leftover fragments. In this case, browse to the item via the total program code subset. You will then get a page describing where the code of that item ended up. If the item is not exclusive to any split point, then you will be shown a list of all split points. If you click on any of them, you will be shown a dependency chain for the item that does not include the split point you selected. To get the item exclusive to some split point, choose a split point, click on it, and then break a link in the dependency chain that comes up. --Sri 2009/10/25 Sripathi Krishnan sripathi.krish...@gmail.com Maybe somebody from google will confirm this, but I doubt you are going to achieve code splitting by using proxies or interfaces, or by using any generic parameterized approach. A piece of code will end up in split-point-1.js *only if* it is always being used from within GWT.runAsync(). If a class can be used from two separate GWT.runAsync() method blocks, it is going to end up in the left-overs block. Now here is my understanding of the situation (of course I may be wrong) - - You have two instances of the class AsyncLoader, say LoaderA and LoaderB, with two unique providers - say ProviderA and ProviderB - GWTC recognizes that there will be two GWT.runAsync() blocks, which is why it creates two split points - But it cannot guarantee that LoaderA will always get ProviderA, and so it should put the code for ProviderA in split-point1.js - So, it knows that the entry point is not using ProviderA or ProviderB - which is why it is not in the initial download fragment. But it cannot guarantee it will always be used from a unique code fragment, which is why it ends up in the left-over fragment. - When you use the inline implementation, you will hard-code the actual provider - and hence things will work. The only pattern that works well is Googles recommended Async Package Patter. See this presentationhttp://dl.google.com/io/2009/pres/Th_1045_TheStoryofyourCompile-ReadingtheTeaLeavesoftheGWTCompilerforanOptimizedFuture.pdf. --Sri 2009/10/25 skrat dusan.malia...@gmail.com I'm trying to split my code using sort of proxies, where I reuse parametrized RunAsyncCallback class. This class has basically just reference to Gin Provider of the real module class. When I use this for loading one module, it works perfectly, and I'm getting nice and correct location of split point in report. When I use this second time, loading different module proxy which uses the same RunAsyncCallback class, both split points happen to be in Leftovers code. Yet, split point on my proxies are still listed in report, but with the same minimal (386) size. I tried to use inline implementation of RunAsyncCallback instead, and surprise! Split points worked correctly again. Here is my parametrized RunAsyncCallback class: class AsyncLoader implements RunAsyncCallback { private ProjectPresenter parent; private PlaceManager placeManager; private Provider? extends AbstractLabeledPresenter real; AsyncLoader( ProjectPresenter parent, Provider? extends AbstractLabeledPresenter real, PlaceManager placeManager ) { this.placeManager = placeManager; this.parent = parent; this.real = real; } @Override public void onFailure(Throwable reason) { // TODO Auto-generated method stub } @Override public void onSuccess() { AbstractLabeledPresenter mod = real.get(); parent.addModule( mod ); if ( mod.hasToken( History.getToken() ) ) { mod.revealDisplay(); parent.show(mod); placeManager.fireCurrentPlace(); } } } This is inner class defined in AbstractLabeledPresenter, that's the same one I'm proxying and loading with GWT.runAsync. @Inject annotation is not present because injection is done on proxy class which in turn instatiates AbstractLabeledPresenter$AsyncLoader. Not sure whether this is bug, but I can't see any linking or any other rason why that code should end up in Leftovers and have empty, zero size split points. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
HashMap argument type mismatch
Hello, I am in the process of converting from gwt 1.5 to 1.7.1 and getting the following error when I am trying to get a HashMap from the server. Any idea why this might happen? I am using JDK 1.6.0_13. The request looks like 5|0|4|http://localhost:54002/Webclient/webclient/| E2C9084EB9E82F1F373FDB40DF5D423D| com.client.web.client.WebClientService|getPropertiesMapNew|1|2|3|4|0| method Return Type shows as class java.util.HashMap typeSignature is java.util.HashMap/962170901 customSerializar is class com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer args is [[1,[java.util.HashMap/962170901],0,5], {XXX=}] looks like in Method.invoke public static void com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer.serialize (com.google.gwt.user.client.rpc.SerializationStreamWriter,java.util.HashMap) throws com.google.gwt.user.client.rpc.SerializationException = Exception while dispatching incoming RPC call com.google.gwt.user.client.rpc.SerializationException: java.lang.IllegalArgumentException: argument type mismatch at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer (ServerSerializationStreamWriter.java:690) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl (ServerSerializationStreamWriter.java:659) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize (ServerSerializationStreamWriter.java:593) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject (AbstractSerializationStreamWriter.java:129) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter $ValueWriter$8.write(ServerSerializationStreamWriter.java:146) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue (ServerSerializationStreamWriter.java:530) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass (ServerSerializationStreamWriter.java:636) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl (ServerSerializationStreamWriter.java:666) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize (ServerSerializationStreamWriter.java:593) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject (AbstractSerializationStreamWriter.java:129) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter $ValueWriter$8.write(ServerSerializationStreamWriter.java:146) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue (ServerSerializationStreamWriter.java:530) at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573) at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess (RPC.java:441) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:529) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:166) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 487) at org.mortbay.jetty.servlet.ServletHandler.handle (ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle (SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle (SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle (ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 505) at org.mortbay.jetty.HttpConnection$RequestHandler.content (HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run (SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:450) Caused by: java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at
GWT Maven2 (1.7.1) Possible?
I'm trying to get a first app up and running with GWT. What I would like to do is download the jars and compile with maven2. Has anyone been able to do this successfully? I can not find any documentation anywhere that actually leads me to a working example. Are the latest 1.7.1 jars available in any public maven repo? Is there any sort of commitment at all from Google to support Maven2? If anyone can help on getting GWT to compile/work with maven I will post the instructions for others in a readable format. If I'm the first to try and get this to run with Maven, let me know. thanks J.V. --~--~-~--~~~---~--~~ 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-contrib] Use native JSON when supported
Reviewers: Ray Ryan, bobv, Description: This patch adds: - JsonUtils.safeParse - JsonUtils.stringify - JsonUtils.isArray (equivalent of ECMAScript 5's Array.isArray) - deferred binding implementations using either native support or emulation (eval() for the parsing) ExternalTextResourcePrototype now uses JsonUtils.safeParse. This patch unfortunately introduces a circular dependency between c.g.g.core.Core and c.g.g.json.JSON to emulate JSON.stringify(); I believe JSONValues should use JsonUtils.stringify (adding overloads eventually) instead of JsonUtilsImplEmulated depending on JSONObject/JSONArray.toString, but it would require a major rewrite of the whole c.g.g.json.JSON module. I'm using a similar code (as an extension, not as a patch) at work with no problem so far. Please review this at http://gwt-code-reviews.appspot.com/86803 Affected files: user/src/com/google/gwt/core/Core.gwt.xml user/src/com/google/gwt/core/JsonUtils.gwt.xml user/src/com/google/gwt/core/client/JsonUtils.java user/src/com/google/gwt/core/client/impl/JsonUtilsImpl.java user/src/com/google/gwt/core/client/impl/JsonUtilsImplEmulated.java user/src/com/google/gwt/core/client/impl/JsonUtilsImplFallback.java user/src/com/google/gwt/core/client/impl/JsonUtilsImplNoArray.java user/src/com/google/gwt/resources/client/impl/ExternalTextResourcePrototype.java --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Extending FocusWidget
Hi, thanks, that helped. I now check for both FocusWidget and HasState On Oct 19, 10:31 pm, Thoka thobias.karls...@gmail.com wrote: Hi, Create an interface, like: public interface HasState { void setEnabled(boolean enabled); boolean isEnabled(); } ...and then implement this with your composite widget. And don't try to cast objects, GWT supports 'instanceof'. :-) I hope this was to any help. P.s. I'm actually confused that such an interface doesn't already exist within the GWT API since many widgets have exactly those two methods. On 19 Okt, 16:07, skrat dusan.malia...@gmail.com wrote: Hi all, all the stuff that FocusWidget does is maybe too much for my case. I only need to cast to something that has setEnabled(boolean) method. In other words I want to create a widget that would act similar to TextBox and similar input widgets. Then I want to checkout Widgets out of my container, try to cast (FocusWidget), and if successful, call setEnabled(). I tried to extend FocusWidget instead of Composite, but my widget stopped working (event handler were not triggered) after that. Any ideas how to overcome this? --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Comment on CodeSplitting in google-web-toolkit
Comment by a.revolution.ultra.blue: One hack I was using to get modules to speak through compilations was using Ray's exporter. Basically, common functions like custom dialogs that cover the screen... If I want them to look nice, but be accessible before I ever access Widget code, I use public static class methods like note(String txt), ask(String question, AsyncCallback response, String ... answers). These methods aren't even in the same package as the code that implements them; they just tunnel through a JS API $wnd.parent.MyExportedAPI. The root API module puts a JS object MyExportedAPI on it's $wnd, then it loads the dll nocache.js files, which implement things like note() and ask(), adding them to MyExportedAPI.Dialog.ask() Finally, each osgi iframe has .nocache.js modules that never access the packages which implement the UI stuff, only static methods that tunnel to $wnd.parent.ME_API {or $wnd.parent.parent...ME_API}. Biggest issue was context. All callbacks from an osgi child of the root must send along it's window variables {NOT $wnd}, and map all the parameters in and out of JSNI. Think: public static native void getFeeling(AsyncCallbackString callback) /*-{ top.MyExportedAPI.ask(How are you, [Good,Great,Alright], { wind: window , callback : callba...@com...asynccallback::onSuccess(Ljava/lang/String;) , err : callba...@com...asynccallback::onFailure(Ljava/lang/Throwable;) }); }-*/; then, to actually perform the callback, in JSNI, x.callback.call(x.wind, 'Great') PROBLEMS {only some of them}: * Memory leaks; adding gwt workspace iframe.contentWindow to every tunneled call could get REAL messy. * Hand coded; it works, but there's piles and piles of boilerplate code; external public static access, a to JSNI bridge method, a from JSNI bridge, and finally, an implementation method. Don't forget @Export boilerplate too! * Tracing errors becomes nearly impossible. Had to make a special, ForeignException so different frames could throw an error and call an asyncCallback.onFailure without ClassCastException. * Accessing osgi subframes {/ls, /dl} without being a child of the root frame = not possible. Power users like to skip straight to the url w/ content, sans fancy multiple-module downloads. * Dlls came in .cache.html, so they didn't block downloads of other code, which I thought was an advantage, but with heavy caching situations, weird page reload bugs happened when the root api changed, but the children did not. * Proxied calls were slow * Event.addNativeEventListener does not work through iframes * Compile times through the roof!! * A giant wad of atrocities I've tried to block out. Trust me, the amount of extra dancing and working you will have to do for dll osgi-like modules will cost you more time than money can replace. And what Ray mentioned before about RPC is that your obfuscated Java objects CANNOT sanely be made translatable unless you RPC encode/decode when tunneling to the root MyExportedAPI. This would mean an encode/decode pair of overhead methods for every paramete or returned object that's not a primitive or JSO. I did all this before runAsync and GWT2.0 was compatible with Appengine, and I TOTALLY ABANDONDED THIS METHOD. It hurt too much to implement. Maybe if I was a generator wizard like Ray it wouldn't be so bad, but at least my package segregation methods made the root API modules transferable to runAsync without worry of external dependancy. ...If you feel like you wasted time reading these run on sentences of mine, do yourself a favor, AND SPARE YOUR CODING TIME, COMPILING TIME AND EXECUTION SPEED: *Monolithic* *Compile* *Is* *The* *Only* _efficient_ *Way* *To* *Obfuscate*, *Split* *And* *Link* *Independent* *Modules*. Any other way means a translation layer and jumping through lots of unnecessary hoops! For more information: http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---