Url rewrite, how?
Hi, how i can use url rewrite on GWT ? for example: www.prsolucoes.com/t...@gmail.com or www.prsolucoes.com/my/test -- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: pa...@prsolucoes.com --~--~-~--~~~---~--~~ 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: Determine implemented interfaces
And Class.isAssignableFrom. --~--~-~--~~~---~--~~ 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 1.7.0
The javadoc suggests you to use .getTextBox.addClickHandler(). http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/SuggestBox.html#addClickListener%28com.google.gwt.user.client.ui.ClickListener%29 On Jul 18, 10:44 pm, twdarkflame darkfl...@gmail.com wrote: ah, still no clickhandelers for Suggestion Boxs then, I expected at least that to be fixed fairly quick :-/ oh well, not that important. On Jul 15, 8:54 am, brett.wooldridge brett.wooldri...@gmail.com wrote: Read the release notes. Very few issues were fixed in 1.7.0, just a few extremely critical issues. On Jul 15, 3:34 pm, Paulo Coutinho pa...@prsolucoes.com wrote: I have compiled my app with new version, but the button size has the same problem, on IE is bigger than other browsers. 2009/7/15 sideview1 sidevi...@gmail.com: nevermind, I was looking at the main pagehttp://code.google.com/p/google-web-toolkit/ but I found the correct location and here are the release notes: http://code.google.com/webtoolkit/releases/release-notes-1.7.0.html Sorry I'm used to the posts pinned to the top in the forum. On Jul 14, 4:03 pm, ben sidevi...@gmail.com wrote: I see that it's out for download now. What updates are in that release? I don't see any milestone in the Issues Tab for the release. And I don't seem to see any posts about the new release? -- Atenciosamente, Paulo Coutinho. Blog:www.prsolucoes.com/blog Site:www.prsolucoes.com Msn: pa...@prsolucoes.com --~--~-~--~~~---~--~~ 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 + email
Hi. I made an RPC for sending an email this is the Impl file: package faceRecognition.server; import com.google.gwt.user.server.rpc.RemoteServiceServlet; import faceRecognition.client.EmailService; import faceRecognition.server.Email.SendMail.Gmail; @SuppressWarnings(serial) public class EmailServiceImpl extends RemoteServiceServlet implements EmailService { @Override public String send(String emailTo, String subject, String body) { String msg = ; msg = Gmail.send(this, emailTo, subject, body); return(msg); } } when i commented out the line msg = Gmail.send(this, emailTo, subject, body); everything is ok. the problem is in the method Gmail.send: package faceRecognition.server.Email.SendMail; import java.security.Security; import java.util.Properties; import javax.mail.*; import javax.mail.internet.*; public class Gmail { private static final String SMTP_HOST_NAME = smtp.gmail.com; private static final String SMTP_PORT = 465; private static final String SSL_FACTORY = javax.net.ssl.SSLSocketFactory; public static String send(String emailFromAddress, String sendTo, String subject, String body){ Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider ()); String[] emails = new String[1]; emails[0] = sendTo; try { sendSSLMessage(usern...@gmail.com, password, emails, subject, body, emailFromAddress); return(); }catch (Exception e) { e.printStackTrace(); return(e.getMessage()); } } private static void sendSSLMessage(final String username, final String password, String recipients[], String subject, String message, String from) throws MessagingException { boolean debug = true; Properties props = new Properties(); props.put(mail.smtp.host, SMTP_HOST_NAME); props.put(mail.smtp.auth, true); props.put(mail.debug, true); props.put(mail.smtp.port, SMTP_PORT); props.put(mail.smtp.socketFactory.port, SMTP_PORT); props.put(mail.smtp.socketFactory.class, SSL_FACTORY); props.put(mail.smtp.socketFactory.fallback, false); Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); session.setDebug(debug); Message msg = new MimeMessage(session); InternetAddress addressFrom = new InternetAddress(from); msg.setFrom(addressFrom); InternetAddress[] addressTo = new InternetAddress [recipients.length]; for (int i = 0; i recipients.length; i++) { addressTo[i] = new InternetAddress(recipients[i]); } msg.setRecipients(Message.RecipientType.TO, addressTo); // Setting the Subject and Content Type msg.setSubject(subject); msg.setContent(message, text/html); //Transport.send(msg); javax.mail.Transport.send(msg); //HERE I GET THE FOLLOWING ERROR } } The error which i get is: DEBUG: getProvider() returning javax.mail.Provider [TRANSPORT,gm,com.google.appengine.api.mail.stdimpl.GMTransport] com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'mail' or call 'Send()' was not found. at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:70) at com.google.appengine.api.mail.MailServiceImpl.doSend (MailServiceImpl.java:96) at com.google.appengine.api.mail.MailServiceImpl.send (MailServiceImpl.java:33) at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage (GMTransport.java:247) at javax.mail.Transport.send0(Transport.java:191) at javax.mail.Transport.send(Transport.java:120) at faceRecognition.server.Email.SendMail.Gmail.sendSSLMessage (Gmail.java:75) at faceRecognition.server.Email.SendMail.Gmail.send(Gmail.java:26) at faceRecognition.server.EmailServiceImpl.send(EmailServiceImpl.java: 17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:527) 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
Re: Creating Stand Alone Composite??
If you create a new project with a module, dont add any entrypoint to this module.Then create all the composites you want in this module. after you may create a jar file of this project (to use anywhere) or you can just import this project into yours (click properties - java build path - projects and add your project - if you have the jar file click on libraries and add the jar.) Then just go to your gwt.xml file and add a line like: inherits name=path.to.your.gwt.xml.File/ the File is the name of the gwt.xml file. example: if the path to gwt.xml file is: com.test.toolkit.Toolkit.gwt.xml put: = com.test.toolkit.Toolkit This way, you can create many modules in the toolkit project, and group the composites by functionality. []s, Bruno BIlescky On Sat, Jul 18, 2009 at 11:40 PM, ToddP todd.prick...@gmail.com wrote: I'm trying to create a stand alone composite widget and am totally clueless as to how. I want to create a widget that will be able to be used in any of my multiple GWT modules. Every example on the web that I can find defines the composite in the same module that displays the composite. I need to see an example of two modules, one defining the composite and one that consumes the composite. If anyone has an example or can point to a web article showing how, I'd GREATLY appreciate it. TIA -- Quer aprender a programar? acompanhe: Wants to learn GWT? Follow this blog - http://tcninja.blogspot.com --~--~-~--~~~---~--~~ 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: Callin an URL from my application
On 07/18/2009 09:54 AM, samuel wrote: Hi Group, I have a requirement where I am making use of an URL for sending mails. Some thing like this http://www.examplemailsending.com/messageapi.asp?username=usernamepassword=passworddestination=A1,A2,A3message=Hi Hi Abhiram, Would it be possible to redesign the interface to not send a password in the URL? Since you're talking to a server, please consider using your server's Sendmail libraries to send the message(s). There are Sendmail libraries for all major CGI languages; such libraries are usually readily available on any respectable hosting service. Put the SMTP authentication parameters into a file outside the directories accessible via the http:// protocol. For example: private -- authentication values; no access via http:// web -- access via http:// http -- .html, .js cgi-bin -- .cgi scripts I am making a list of all the people A1, A2, A3... to whom the Hi message needs to be sent. If you want the message to be sent from the client, consider using the mailto: url. Here is an example. Google for other information: mailto:bar...@rubble.com,f...@flintstone.com,wi...@flintstone.com ?subject=Meeting%20at%20the%20quarry body=Hi:%0d%0aSee%20you%20there If you paste this url into your brower's address window, your email client should respond with a new message. This technique may not work on all client computers; which is why invoking Sendmail from your hosting provider may be a more universal solution. Can someone tell me which is the best way to implement this requirement?? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to persist data
Hi,I have a config.xml file that contains stuffs like domain name, username, password, connection string. This file is loaded into a signleton when the web application first contacts the server. How do I persist the signleton so that the app does not have to reread the xml file in the next request? 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: How to persist data
On 07/19/2009 11:37 AM, Pham Tran Quoc Viet wrote: Hi, I have a config.xml file that contains stuffs like domain name, username, password, connection string. This file is loaded into a signleton when the web application first contacts the server. How do I persist the signleton so that the app does not have to reread the xml file in the next request? Thanks. Google for java singleton. Most of the answers you get from that request will be applicable to GWT. --~--~-~--~~~---~--~~ 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 persist data
Singletons are evil. Sent from my Archimedes A3000 -Original Message- From: Jeff Chimene jchim...@gmail.com Date: Sun, 19 Jul 2009 12:15:35 To: Google-Web-Toolkit@googlegroups.com Subject: Re: How to persist data On 07/19/2009 11:37 AM, Pham Tran Quoc Viet wrote: Hi, I have a config.xml file that contains stuffs like domain name, username, password, connection string. This file is loaded into a signleton when the web application first contacts the server. How do I persist the signleton so that the app does not have to reread the xml file in the next request? Thanks. Google for java singleton. Most of the answers you get from that request will be applicable to GWT. --~--~-~--~~~---~--~~ 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 inherit external module jxl ? Problems working with excel sheets
You could do this using a file upload to the server, do the excel work on the server side and then serialize the data and send it back to the client, displaying it in any way you want using GWT. --Dalla http://date-time.appspot.com/ On 17 Juli, 03:19, sly sly.wicker...@gmail.com wrote: So is there no way for me to go ahead with using this module ? How else can I work with excel sheets ? Please do help me. My application needs to import an external excel sheet browsed in by the user and the data needs to be read and displayed using GWT. If anyone knows any working gwt app/project please do let me know. On Jul 16, 1:06 pm, Isaac Truett itru...@gmail.com wrote: After going through many of the threads here, I found out that the reason for this is that I have not inherited this module into my project. Where I am stuck right now is, HOW toINHERITit ??? You can't, because it isn't a GWT module. The classes you're trying to use (java.io.File, for example) are not part of a GWT module and they're not JRE classes that GWT emulates. Those classes can't be compiled into JS to run in the browser. On Wed, Jul 15, 2009 at 9:57 PM, slysly.wicker...@gmail.com wrote: I'm new to gwt and have been working on a project which works with excel sheets. I need to read an excel sheet and use that data in my application. I have included the jar found in this url in the build path http://jexcelapi.sourceforge.net/. I'm developing on eclipse. When I run the project as a gwt app I get the following error. Line 20: No source code is available for type java.io.FileInputStream; did you forget toinherita required module? Line 22: No source code is available for type java.io.File; did you forget toinherita required module? Line 38: No source code is available for type jxl.Sheet; did you forget toinherita required module? Line 45: No source code is available for type java.io.InputStream; did you forget toinherita required module? Line 46: No source code is available for type jxl.WorkbookSettings; did you forget toinherita required module? Line 47: No source code is available for type jxl.Workbook; did you forget toinherita required module? Line 49: No source code is available for type jxl.Cell; did you forget toinherita required module? Line 52: No source code is available for type jxl.DateCell; did you forget toinherita required module? Line 57: No source code is available for type java.util.Locale; did you forget toinherita required module? Line 104: No source code is available for type jxl.read.biff.BiffException; did you forget toinherita required module? After going through many of the threads here, I found out that the reason for this is that I have not inherited this module into my project. Where I am stuck right now is, HOW toINHERITit ??? Below is a copy of my .gwt.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 1.6.4// EN http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro- source/core/src/gwt-module.dtd module rename-to='gwtsample' inherits name='com.google.gwt.user.User'/ inherits name='com.google.gwt.user.theme.standard.Standard'/ entry-point class='com.sample.client.gwtsample'/ inherits name=com.google.gwt.maps.GoogleMaps / script src=http://maps.google.com/maps? gwt=1file=apiv=2sensor=false;key=0UJTPX2XKYcABhyx5VXkq- K2YctzpXUYhHEfWTQ / /module I do not how toinheritthe jxl module. Below is a copy of my import statements in one of my class file import jxl.Cell; import jxl.DateCell; import jxl.Sheet; import jxl.Workbook; import jxl.WorkbookSettings; import jxl.read.biff.BiffException; I tried inherits name=jxl.Cell/ and so on for all those classes . And still its not working. Can anyone please help me regarding this, I need to overcome this very badly. I'm a student and my project has stagnated for a few days and I cannot afford more of it. Also if anyone can help me with a sample gwt application which reads/ writes an excel sheet, would really help me learn a lot. Thanking in advance. in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: HTML.getElement.setAttribute(style, background-color:...) not working in IE
Awesome, thanks for the help, that should be exactly what I need. Another issue i was having was dealing with adding EventHandlers to certain elements such as the TableRowElement. Do you happen to know of a utility or something that I just can't find that I can use? I have a post at http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/030e95ad088d159d?hl=en if you'd like to take a look. Thanks again On Jul 17, 1:30 pm, Paul Robinson ukcue...@gmail.com wrote: When setting css attributes from javascript (and hence also GWT), you must use camel case. That means backgroundColor instead of background-color. You might also like to use the Style object, so you can write (IIRC): getElement().getStyle().setProperty(backgroundColor, color); better still (although I suspect only with trunk): getElement().getStyle().setBackgroundColor(color); Paul bconoly wrote: I'm trying to dynamically set the background-color of a div with a set width and height using the HTML.getElement.setAttribute(style, background-color: + color) method and it works fine in firefox but IE for some reason isn't getting the style attribute added to the div element. Does anyone have any idea why that is and how I may be able to fix it? 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 -~--~~~~--~~--~--~---
Standard JSP + GWT Usage
Hello, My intro is a bit long but it would explain my case. Pls bear with me... Many thanks... I've started experimenting on a JSP + GWT coupling as part of a project I'm doing. This together with Struts 2.0 is a part of a project initiative that would expand the use of rich UI within a product. The idea comes in different flavors... 1. First and foremost is to use an already existing header page component with GWT components as the underlying content. 2. Have that GWT body communicate and reuse existing JSPs which are already standard within the project. 3. And of course, have JSPs communicate with the GWT body. Status of my work: I have successfully coupled the header with a GWT body. This also more or less answered the question on how I would facilitate the communication between my GWT section with the rest of the JSPs (vice- versa). I've implemented these simple experiment right on top of Struts 2.0. The makeup of the pages. To incorporate the already existing header JSP. I've renamed the GWT generated project.html to project.jsp and moved the GWT script tag component within the head tag of the header as the last element. e.g. project.jsp 1. include header 2. the rest of the elements here... Problem: When I try to proceed to another JSP right after a button is clicked from the header, say next.jsp with the following makeup... next.jsp 1. include header 2. the rest of the elements here... ... I end up seeing the following... 1. The header 2. The intended contents of next.jsp 3. The GWT content previously viewed prior to redirecting to next.jsp. Questions: 1) The first question is, why? 2) I was wondering if I would need to do an elaborate DOM element handling here to fix this. Or have I been doing anything wrong? 3) Is this coupling even feasible to implement? Any knowledge enriching feedback would be greatly appreciated. Thanks so much, Vince --~--~-~--~~~---~--~~ 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: Callin an URL from my application
Hi, I had a similar issue and this is how I was shown to do it. public native void gotoURLscript(String url) /*-{ open(url); }-*/; Usage: public void gotoURL(String url) { gotoURLscript(URL.encode(url)); } This will do any url on your client. If you are wishing one that only does local mail from the client. private static native void mailtoImpl(String address, String subject) /*-{ $wnd.location = mailto:; + address + ?subject= + subject; }-*/; public static void SendMail(String emailaddress, String subject) { mailtoImpl(emailaddress, URL.encode(subject)); } Hope this helps. On Jul 19, 11:55 am, Jeff Chimene jchim...@gmail.com wrote: On 07/18/2009 09:54 AM, samuel wrote: Hi Group, I have a requirement where I am making use of an URL for sending mails. Some thing like this http://www.examplemailsending.com/messageapi.asp?username=usernamepassword=passworddestination=A1,A2,A3message=Hi Hi Abhiram, Would it be possible to redesign the interface to not send a password in the URL? Since you're talking to a server, please consider using your server's Sendmail libraries to send the message(s). There are Sendmail libraries for all major CGI languages; such libraries are usually readily available on any respectable hosting service. Put the SMTP authentication parameters into a file outside the directories accessible via the http:// protocol. For example: private -- authentication values; no access via http:// web -- access via http:// http -- .html, .js cgi-bin -- .cgi scripts I am making a list of all the people A1, A2, A3... to whom the Hi message needs to be sent. If you want the message to be sent from the client, consider using the mailto: url. Here is an example. Google for other information: mailto:bar...@rubble.com,f...@flintstone.com,wi...@flintstone.com ?subject=Meeting%20at%20the%20quarry body=Hi:%0d%0aSee%20you%20there If you paste this url into your brower's address window, your email client should respond with a new message. This technique may not work on all client computers; which is why invoking Sendmail from your hosting provider may be a more universal solution. Can someone tell me which is the best way to implement this requirement??- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 architecture MVP/EventBus (mentioned at Google I/O)
For everyone following this thread, I would recommend to take a look in the presenter's implementation created by David http://gwt-presenter.googlecode.com I'm taking a look on it too, and it seems to be very interesting. I will port my little application as a proof concept. As soon as possible I will post here a feedback. Best regards, Eduardo S. Nunes On Wed, Jul 15, 2009 at 4:43 AM, Thomas Broyert.bro...@gmail.com wrote: On 13 juil, 11:18, Kwhit kwhitting...@gmail.com wrote: I'm following your work with interest Eduardo, I'm in the process of building a 'dream-team reference application' myself including RPC, EasyMock, GIN, Guice, ... so I can unit test and hack end-to-end without deploying on a server. Here's question / comment... I don't understand the go() method on the presenter impl classes. Take for example mainPresenter.go(): it does a bit of widget composition adding the menu and returns the view which is the job of getView(). Then in go() you call menuPresenter.showMenu() which doesn't actually show the menu but instead it returns the view which is again the job of MenuPresenterImpl.getView(). My guess is you are (like me) having some problems in the last metre of the 100m just glueing the application together. I don't have a nice answer for that yet... Just a thought: how about building *some of* the view hierarchy via DI too and inject the very same views (widgets) in both their parent widget (for view compositing) and presenter? (only in the case of singletons of course, and use providers and/or these getView/getWidget methods we've talked about otherwise). E.g. in Eduardo's sample: inject a MenuWidget instance into both the MainWidget constructor and the MenuPresenterImpl (MenuWidget is laid out by MainWidget and controlled by MenuPresenterImpl); and in the case of the IssueDisplayXXX and IssueEditXXX, use providers as of today for lazy-init (inject ProviderIssueDisplayWidget and ProviderIssueEditWidget into MainWidget), but use singletons though, so that the view and presenter are correctly associated while still using two distinct, unrelated providers. And only in those cases where you need several instances of a component (presenter/view) you'd have to use the getView/getWidget methods so that you get/create a presenter instance from the Ginjector which gets injected its own view. It's just an idea, feel free to reject it with whichever argument comes to your mind ;-) -- Eduardo S. Nunes http://e-nunes.com.br --~--~-~--~~~---~--~~ 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: Hooking a GWT event onto an element in an external iframe
Hi Tin, There is a potential for memory leaks via event listeners due to cyclical references between DOM and JS. To avoid this, GWT manages the event listeners via the Widget lifecycle. When the widget is attached to the DOM (i.e. it or it's ancestor is attached to a RootPanel) the widget's event listener is initialized. When the widget is detached (or the page is unloaded) the event listener is cleaned up. You can see the code in Widget.onAttach() and Widget.onDetach(). I'd say it is erroneous to use Widget outside of the normal Widget containment hierarchy. Instead, we can set an event listener directly: DOM.setEventListener(buttonElement, new EventListener() { // you will only get the events you sink void onBrowserEvent(Event event) { // references in this method can result in a memory leak Window.alert(GWT-hacky-clicked!); } }); // connect the foreign element to the GWT event dispatcher DOM.sinkEvents(buttonElement, Event.ONCLICK); Also consider adding a Window CloseHandler to prevent the memory leak. Window.addCloseHandler(new CloseHandlerWindow() { public void onClose(CloseEventWindow event) { DOM.setEventListener(buttonElement, null); } }); You can also look at HandlerManager and DomEvent.fireNativeEvent() to see how to translate Event into a ClickEvent, but IMO that is overkill. -= Mat On Thu, Jul 16, 2009 at 4:27 PM, tintin.pavli...@gmail.com wrote: I am writing a GWT app that involves interacting with an external document in an iframe. As a proof of concept, I am trying to attach a click handler to a button. The following works in javascript var iframe = document.getElementById(rawJSIFrame); var doc = iframe.contentDocument; var body = doc.body; var button = doc.getElementsByTagName(input).namedItem(submit); button.onclick = function() { alert(Clicked!); }; Trying to do the equivalent in GWT, I did the following: public void addClickHandlerToSubmitButton(String buttonElementName, ClickHandler clickHandler) { IFrameElement iframe = IFrameElement.as(frame.getElement()); Document frameDocument = getIFrameDocument(iframe); if (frameDocument != null) { Element buttonElement = finder(frameDocument).tag(input).name (buttonElementName).findOne(); ElementWrapper wrapper = new ElementWrapper(buttonElement); HandlerRegistration handlerRegistration = wrapper.addClickHandler(clickHandler); } } private native Document getIFrameDocument(IFrameElement iframe)/*-{ return iframe.contentDocument; }-*/; The following is the ElementWrapper class: public class ElementWrapper extends Widget implements HasClickHandlers { public ElementWrapper(Element theElement) { setElement(theElement); } public HandlerRegistration addClickHandler(ClickHandler handler) { return addDomHandler(handler, ClickEvent.getType()); } } The code to find the button works fine but the actual click event handler is not getting invoked. Has anybody had a similar issue before, and how did you resolve it? --~--~-~--~~~---~--~~ 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] noserver should be, well, -noserver
Reviewers: Lex, jat, Description: Minor (but significant!) typo from r5094... Passes on my XP box, at least. Please review this at http://gwt-code-reviews.appspot.com/47821 Affected files: user/build.xml Index: user/build.xml === --- user/build.xml (revision 5751) +++ user/build.xml (working copy) @@ -153,7 +153,7 @@ /target target name=test.noserver depends=compile, compile.tests description=Run noserver hosted-mode tests for this project. -gwt.junit test.args=${test.args} test.out=${junit.out}/${build.host.platform}-noserver-mode test.cases=default.noserver.tests +gwt.junit test.args=${test.args} -noserver test.out=${junit.out}/${build.host.platform}-noserver-mode test.cases=default.noserver.tests extraclasspaths path refid=test.extraclasspath / /extraclasspaths --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5752 - Checkstyle comment fix.
Author: fabb...@google.com Date: Sun Jul 19 09:52:17 2009 New Revision: 5752 Modified: trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java Log: Checkstyle comment fix. Modified: trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java == --- trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java (original) +++ trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java Sun Jul 19 09:52:17 2009 @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; +/** Tests the fragment loader. */ public class AsyncFragmentLoaderTest extends TestCase { private static class MockErrorHandler implements LoadErrorHandler { private boolean wasCalled = false; --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5753 - Checkstyle comment fixes (period on first sentence, a few extra @params).
Author: fabb...@google.com Date: Sun Jul 19 11:17:55 2009 New Revision: 5753 Modified: trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java trunk/user/src/com/google/gwt/dom/client/Document.java trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java trunk/user/src/com/google/gwt/user/rebind/rpc/CustomFieldSerializerValidator.java trunk/user/test/com/google/gwt/dom/client/DocumentTest.java trunk/user/test/com/google/gwt/dom/client/FormTests.java trunk/user/test/com/google/gwt/dom/client/MapTests.java trunk/user/test/com/google/gwt/dom/client/NodeTest.java trunk/user/test/com/google/gwt/dom/client/SelectTests.java trunk/user/test/com/google/gwt/dom/client/TableTests.java trunk/user/test/com/google/gwt/emultest/java/lang/C.java trunk/user/test/com/google/gwt/emultest/java/util/StackProfile.java trunk/user/test/com/google/gwt/emultest/java/util/StackTest.java trunk/user/test/com/google/gwt/i18n/rebind/MessageFormatParserTest.java trunk/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTest.java trunk/user/test/com/google/gwt/user/client/ui/CreateEventTest.java trunk/user/test/com/google/gwt/user/maptests/FastStringMapTest.java trunk/user/test/com/google/gwt/user/server/rpc/RPCTest.java Log: Checkstyle comment fixes (period on first sentence, a few extra @params). Modified: trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java == --- trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java (original) +++ trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java Sun Jul 19 11:17:55 2009 @@ -42,7 +42,7 @@ public abstract String[] getJavaScript(); /** - * Returns the permutation ID + * Returns the permutation ID. */ public abstract int getPermutationId(); Modified: trunk/user/src/com/google/gwt/dom/client/Document.java == --- trunk/user/src/com/google/gwt/dom/client/Document.java (original) +++ trunk/user/src/com/google/gwt/dom/client/Document.java Sun Jul 19 11:17:55 2009 @@ -1024,7 +1024,7 @@ }-*/; /** - * Enables or disables scrolling of the document + * Enables or disables scrolling of the document. * * @param enable whether scrolling should be enabled or disabled */ Modified: trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java == --- trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java(original) +++ trunk/user/src/com/google/gwt/rpc/server/RpcServlet.javaSun Jul 19 11:17:55 2009 @@ -288,7 +288,6 @@ * * @param request the request being served * @param response the response that will be written into - * @param responsePayload the payload that is about to be sent to the client * @return codetrue/code if responsePayload should be GZIP compressed, * otherwise codefalse/code. */ Modified: trunk/user/src/com/google/gwt/user/rebind/rpc/CustomFieldSerializerValidator.java == --- trunk/user/src/com/google/gwt/user/rebind/rpc/CustomFieldSerializerValidator.java (original) +++ trunk/user/src/com/google/gwt/user/rebind/rpc/CustomFieldSerializerValidator.java Sun Jul 19 11:17:55 2009 @@ -105,12 +105,6 @@ * Returns a list of error messages associated with the custom field * serializer. * - * @param streamReaderClass - * {...@link com.google.gwt.user.client.rpc.SerializationStreamReader - * SerializationStreamReader} - * @param streamWriterClass - * {...@link com.google.gwt.user.client.rpc.SerializationStreamWriter - * SerializationStreamWriter} * @param serializer the class which performs the serialization * @param serializee the class being serialized * @return list of error messages, if any, associated with the custom field Modified: trunk/user/test/com/google/gwt/dom/client/DocumentTest.java == --- trunk/user/test/com/google/gwt/dom/client/DocumentTest.java (original) +++ trunk/user/test/com/google/gwt/dom/client/DocumentTest.java Sun Jul 19 11:17:55 2009 @@ -120,7 +120,7 @@ } /** - * getElementById, getElementsByTagName + * getElementById, getElementsByTagName. */ public void testGetElements() { Document doc = Document.get(); @@ -140,7 +140,7 @@ } /** - * domain, referrer, title, url + * domain, referrer, title, url. */ public void testProperties() { Document doc = Document.get(); Modified: trunk/user/test/com/google/gwt/dom/client/FormTests.java
[gwt-contrib] Re: noserver should be, well, -noserver
lgtm. http://gwt-code-reviews.appspot.com/47821 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5754 - Making test.noserver actually use -noserver.
Author: fabb...@google.com Date: Sun Jul 19 11:38:45 2009 New Revision: 5754 Modified: trunk/user/build.xml Log: Making test.noserver actually use -noserver. Review by: knorton Modified: trunk/user/build.xml == --- trunk/user/build.xml(original) +++ trunk/user/build.xmlSun Jul 19 11:38:45 2009 @@ -153,7 +153,7 @@ /target target name=test.noserver depends=compile, compile.tests description=Run noserver hosted-mode tests for this project. -gwt.junit test.args=${test.args} test.out=${junit.out}/${build.host.platform}-noserver-mode test.cases=default.noserver.tests +gwt.junit test.args=${test.args} -noserver test.out=${junit.out}/${build.host.platform}-noserver-mode test.cases=default.noserver.tests extraclasspaths path refid=test.extraclasspath / /extraclasspaths --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Trouble building GWT 2.0 from svn
Same as Brett, that's all you need. Using ant 1.7.1 java 6u14 amd64. On Jul 19, 4:01 am, brett.wooldridge brett.wooldri...@gmail.com wrote: Not sure what the problem is. This is all I did (literally): mkdir gwt-trunk cd gwt-trunk svn checkouthttp://google-web-toolkit.googlecode.com/svn/tools/tools svn checkouthttp://google-web-toolkit.googlecode.com/svn/trunk/trunk cd trunk ant That's it. I didn't set any environment variables (not even GWT_TOOLS), I have no classpath in my environment, etc. The only thing in my path is Ant and Java. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---