Re: How can I get a class by it's name and then construct it?
Hi Shedokan, you can do this on the server, not on the client. A few weeks ago, I ran into the same problem. Here is my solution: -> send the string with the classname to the srever. -> then do the following: myClass = Class.forName(className); Constructor myConstr = myClass.getDeclaredConstructor(); myModule = myConstr.newInstance(); Note that myModule is in my case an interface, and every class, which you construct with Reflection, implements this inteerface. return myModule; Return myModule/your generated class to the client/GWT, and you can use it there. I think it´s a really nice solution. Just try it. Greets Alex On 3 Sep., 15:43, Shedokan wrote: > Hello, > I am trying to split my code and load classes by a name I get from the > server. > I tried using Class.forName("com.app.classes."+className) but GWT > doesn't support it. > > How can I get a class and then construct it like this: > new (getClass("com.app.classes."+className))("Param1", "param2"); > > 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: problems with auto-complete form login
Thomas, I was too quick when saying that it works with iframes: The login page was shown correctly and the browser offered autofill, but FormPanel.wrap caused an exception which I could not get away (i think a JS exception). Then I tried a combination of both - external login and visual GWT integration: I made an external JSP page for the log, totally outside of GWT, but I loaded this JSP page into an iframe so that it showed up within my GWT app. The only problem is, when I submit the login form inside the iframe, the login page redirects to my app inside the iframe. So the app appears inside the iframe. Isn't there a way to do the following: If the login form within the iframe is submitted, reload the app outside the iframe. Magnus On 3 Sep., 19:00, Magnus wrote: > Hmmm...I would like to get my peace with this, but... > > I now created an invisible iframe in my host html. > On login I just show it, so it's a native html form. > It's not so nice as a DialogBox, but it works. > > I cannot see why this is bad. > > Why is it bad? > > You see, I cannot let it go... :-) > > Magnus > > On Sep 2, 3:47 am, Thomas Broyer wrote: > > > On Sep 1, 3:42 pm, Magnus wrote: > > > > Hi Thomas, > > > > I have thought about this the whole day now and it really sounds > > > interesting to me to give it a try with external login, but - if I > > > understood you right - I see a big disatvantage: > > > > Many applications are not or should not be usable at all when the user > > > is not logged in. But there are also applications that should be > > > usable (in a limited way) without login. > > > > Consider eBay: You can search and browse as nobody, but if you want to > > > sell, you have to sign in. Or consider a chess application: You can > > > watch everything, but if you want to create a new game, you have to > > > sign in first. Consider a forum: You can read a lot, but not > > > everything, but after you login, you can read everything and also > > > write. > > > > So my problem is that with your method I had to lock out all guest > > > users that just want to come and see what is going on there! > > > Not necessarily. > > The setup I described about web.xml, etc. would make it behave as you > > describe, but that's just one way to do "externalized login", and a > > way that doesn't make "guest access" possible (to make things simpler > > and keeping the advantages of container-managed login using servlet > > FORM or JASPIC, you could just use 2 "host pages": a world-accessible > > one and a restricted one, possible using redirections and so on to > > make it "work as intended" in every corner case, I haven't tested; I > > bet you'll find plenty of examples on the Web about doing guest and > > authenticated access on the same resource in Java servlet/JSP) > > > In every of the 3 cases you cite, I don't see a problem in reloading > > the app when switching from unauthenticated to authenticated access > > (if you want to keep some information around –such as your shopping > > cart–, send it as part of the login process –or store it on the server > > and pass some ID around–). YMMV of course (and I didn't say > > "externalize login" is a silver bullet, you might really want/need > > some UX that would make it impossible to use). > > > One possibility too is to only allow a guest-to-authenticated-user > > workflow without reloading the app ("integrated login"). As soon as > > the user wants to sign out, then reload the app and start back in > > "guest mode". That way, you don't have to fear about restricted data > > "leaking" between user sessions, but you'd still have to make sure to > > clear some client-side caches (depending on your use case; for the > > forum case you gave, for instance, clear the list of posts so you'll > > reload them from the server and see the "restricted posts"). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT war file inside a EAR file
Bad news. Still no working. I created the weblogic-application.xml descriptor file and it is still not working =/ I got the following error: An error occurred during activation of changes, please see the log for details. weblogic.application.ModuleException: com/c/w/server/MyServiceImpl : com/google/gwt/user/server/rpc/RemoteServiceServlet Any idea? If i package like a simple war file it works pretty fine. Thank you! 2010/9/5 KevMo > I've successfully created an EAR with GWT and glassfish, it wasn't too > difficult. I used gilead with hibernate for persistence. The only > trick was getting GWT to compile, as my entities are in the EJB, and > GWT was in the WAR. I simply made sure the .java files we available > to the WAR. I can provide a sample project if needed. > > Cheers, > Kevin > > > On Sep 4, 5:51 pm, Marcelo Balloni wrote: > > Hi Mariano, > > > > Thank you very much. > > > > I Already have an application.xml descriptor with exactly all proper > > configurations. > > > > What i don't have is a weblogic-application.xml descriptor, but i'll try > it > > no later than monday. > > > > But i must ask, what if i try to deploy on glassfish or jboss per > example > > (real situation here)? do i need some particular descriptor to? > > > > Actually i haven't tested deploying it on glassfish before, gonna do > that. > > > > One more time thank you very much. > > > > 2010/9/4 Mariano > > > > > > > > > Hi Marcelo, > > > > > Some weeks ago I've implemented exactly what you are trying (putting > > > the WAR inside an EAR file and deploying it into a Weblogic server). > > > > > Doing it it was pretty straightforward in my case, I didn't need any > > > change regarding GWT coding or deployment. > > > > > The steps I followed were: > > > > > 1. Create an "application.xml" descriptor > > > 2. Create a "weblogic-application.xml" descriptor > > > 3. Do all the proper EAR packaging (see next paragraph for my > > > directory layout) > > > > > After doing that in order to deploy it in Weblogic, just copy that EAR > > > file into your /autodeploy directory OR deploy it thru > > > WebLogic's console as any usual application. > > > > > This is my directory layout: > > > > > /META-INF/MANIFEST.MF > > > /META-INF/application.xml > > > /META-INF/weblogic-application.xml > > > /myapp.war > > > > > And the contents of my deployment descriptor files are: > > > > > Content of META-INF/application.xml: > > > > > > > > > > > > Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'> > > > > > > > > My Application > > > My Application description > > > > > > > > > > > > > > myapp.war > > > myapp > > > > > > > > > > > > > > > > Content of META-INF/weblogic-application.xml: > > > > > > > > > > WebLogic Application 8.1.0//EN" " > http://www.bea.com/servers/wls810/dtd/ > > > weblogic-application_2_0.dtd"> > > > > > > > > > > > > > > > > > > > > > > > > > > Hope it helps and good luck, > > > Mariano Ortega > > > > > On Sep 2, 4:47 pm, Marcelo Balloni wrote: > > > > Hi folks! > > > > > > I developed a gwt application and package it as a war file. > Everything > > > > works fine. > > > > But when i try to package it inside an EAR file all my remote > callings > > > > stoped to work (i'm using gwt default remoteserlvet calls). Actually > i > > > can't > > > > even deploy in weblogic (it gives an error). > > > > > > I've tried everything but without success =/ > > > > Is there something else i'm missing on gwt ear deployment? > > > > > > Thank you! > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to > google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-web-toolkit+unsubscr...@googlegroups.com cr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Getting intelligent behavior out of DateBox
In a standard DateBox, the DatePicker is automatically visible when the DateBox gets focus. To change the parsing rules for dates typed by the user, you'll want to write a custom date parser. The basic approach is to subclass DateBox and do this: setFormat(new CustomDateFormat(getFormat()); ... private static class CustomDateFormat extends DateBox.DefaultFormat { public CustomDateFormat(DateTimeFormat dateTimeFormat) { super(dateTimeFormat); } @Override public Date parse(CustomDateBox dateBox, String dateText, boolean reportError) { Date date = null; // First, see if the GWT date parser can handle it try { if (dateText.length() > 0) { date = getDateTimeFormat().parseStrict(dateText); } } catch (Exception e) { // http://code.google.com/p/google-web-toolkit/issues/detail?id=4633 } // If GWT couldn't parse it, try my custom date parser if (date == null) { // custom code...parse the date however you like: date = customParseDate(dateText); } return date; } } On Sep 5, 7:59 pm, GregD wrote: > I'm writing an app for which DateBox could be quite useful. > Unfortunately, its default behavior is so lacking that I can't use it, > unless I can fix it. > > Issue 1: If I type in a month and day, instead of adding the current > year, it reports an error. > Issue 2: If I type in a date like :11/7/7, DateBox translates the date > as November 7, 1907. > > Can I fix those behaviors? Lacking that, anyone have a date picker > icon I can use on a little button to bring up a DatePicker when my > users want to deal with one? > > TIA, > > Greg -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Popup menu
Has anyone here made a popup menu using MenuBar? My current approach is to simply put a vertical MenuBar in a PopupPanel. But I do not want to be forced to explicitly close the popup panel in my menu commands. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: blobstore not allowing access to a file <1 mb with one api call + zip files
You'll need to start a task to do the job, but tasks are limited to 30s. In this case you use the mapreduce api, to read the entire blob you upload and do what you need. Here is my Demo GWT project for Blobstore upload: http://demofileuploadgae.appspot.com/ Here is code for the demo: http://code.google.com/p/gwt-examples/source/browse/#svn/trunk/DemoUpload/src/org/gonevertical/upload/server/mapreduce This doesn't have the exact code you need, but has the frame you'll need to get going with the api. It works fantastic for reading blobs. Hope that helps, Brandon Donnelson On Aug 20, 10:46 am, GKotta wrote: > Hi, > > I have my users upload a zip file full of images (all of which are > less than 1 mb, so theoretically, I should be able to access each > image with one api call.) The problem is that this doesn't work in > practice. I want to use theblobstoreto upload the zip file then put > each individual image in the datastore. Below is my code. The method > getNextEntry() reads the next ZIP file entry and positions the stream > at the beginning of the entry data. > > Map blobs = blobstoreService.getUploadedBlobs(req); > BlobKey blobKey = blobs.get("uploadFormElement"); > ZipInputStream zipper = new ZipInputStream(new > BlobstoreInputStream(blobKey)); > ZipEntry entry = zipper.getNextEntry(); > int read; > int start = 0; > byte[] buffer = new byte[1048576]; > > while ((read = zipper.read(buffer, start, buffer.length)) != > -1) > start += > read; > > byte[] imageBytes = new byte[start]; > > System.arraycopy(buffer, 0, imageBytes, 0, start); > > Blob imageBlob = new Blob(imageBytes); > > The exception that I get is "Caused by: > com.google.apphosting.api.ApiProxy$ApplicationException: > ApplicationError: 6: Blob fetch size too large." on the line "ZipEntry > entry = zipper.getNextEntry();" > > Does anyone know how to solve this? > > 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: AccessControlExeption: Access Denied
Here is what I did to upload: http://demofileuploadgae.appspot.com/ - demo http://code.google.com/p/gwt-examples/source/browse/#svn/trunk/DemoUpload/src/org/gonevertical/upload/server%3Fstate%3Dclosed - Code On Aug 2, 5:07 pm, GKotta wrote: > Hi Tom, > > thanks for your answer. I tried using your code and I got the > following error. I imported the BlobstoreInputStream, and it compiles, > but I get a ClassNotFoundError. I am using eclipse with the gwt plugin > > Code: > > import com.google.appengine.api.blobstore.BlobstoreInputStream; > > BufferedReader reader = new BufferedReader((new InputStreamReader(new > BlobstoreInputStream(new > BlobKey(filename); > > Error: > > java.lang.NoClassDefFoundError: com/google/appengine/api/blobstore/ > BlobstoreInputStream > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Unknown > Source) > at java.lang.Class.getConstructor0(Unknown Source) > at java.lang.Class.newInstance0(Unknown Source) > at java.lang.Class.newInstance(Unknown Source) > at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java: > 153) > at > org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java: > 428) > at > org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java: > 339) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: > 487) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1166) > at > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi > lter.java: > 51) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1157) > at > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans > actionCleanupFilter.java: > 43) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1157) > at > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile > Filter.java: > 122) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1157) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: > 388) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: > 216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: > 182) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: > 765) > at > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: > 418) > at > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn > gineWebAppContext.java: > 70) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > 152) > at > com.google.appengine.tools.development.JettyContainerService > $ApiProxyHandler.handle(JettyContainerService.java:349) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > 152) > at org.mortbay.jetty.Server.handle(Server.java:326) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: > 542) > at org.mortbay.jetty.HttpConnection > $RequestHandler.content(HttpConnection.java:938) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: > 218) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: > 404) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: > 409) > at org.mortbay.thread.QueuedThreadPool > $PoolThread.run(QueuedThreadPool.java:582) > Caused by: java.lang.ClassNotFoundException: > com.google.appengine.api.blobstore.BlobstoreInputStream > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at > com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(Iso > latedAppClassLoader.java: > 151) > at java.lang.ClassLoader.loadClass(Unknown Source) > ... 33 more > > Can you help? > > I should also mention that I import the following classes and they > work: > import com.google.appengine.api.blobstore.BlobKey; > import com.google.appengine.api.blobstore.BlobstoreService; > import com.google.appengine.api.blobstore.BlobstoreServiceFactory; > > 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this gro
Re: GWT with GAE Blobstore
Here is what I did to upload: http://demofileuploadgae.appspot.com/ - demo http://code.google.com/p/gwt-examples/source/browse/trunk/DemoUpload/ - Source Code Brandon Donnelson -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: problems with auto-complete form login
Hello Magnus, That's called "Breaking out of frames" [1]. If you need your app to be able to detect a valid login, then you'll need to communicate from within the iframe to the hosting app that the login was ok (have a look at window.name transport in this case [2]) [1] http://www.blooberry.com/indexdot/html/topics/breakframe.htm [2] http://development.lombardi.com/?p=611 On Sep 6, 3:00 pm, Magnus wrote: > Thomas, > > I was too quick when saying that it works with iframes: The login page > was shown correctly and the browser offered autofill, but > FormPanel.wrap caused an exception which I could not get away (i think > a JS exception). > > Then I tried a combination of both - external login and visual GWT > integration: > > I made an external JSP page for the log, totally outside of GWT, but I > loaded this JSP page into an iframe so that it showed up within my GWT > app. > > The only problem is, when I submit the login form inside the iframe, > the login page redirects to my app inside the iframe. So the app > appears inside the iframe. > > Isn't there a way to do the following: > If the login form within the iframe is submitted, reload the app > outside the iframe. > > Magnus > > On 3 Sep., 19:00, Magnus wrote: > > > Hmmm...I would like to get my peace with this, but... > > > I now created an invisible iframe in my host html. > > On login I just show it, so it's a native html form. > > It's not so nice as a DialogBox, but it works. > > > I cannot see why this is bad. > > > Why is it bad? > > > You see, I cannot let it go... :-) > > > Magnus > > > On Sep 2, 3:47 am, Thomas Broyer wrote: > > > > On Sep 1, 3:42 pm, Magnus wrote: > > > > > Hi Thomas, > > > > > I have thought about this the whole day now and it really sounds > > > > interesting to me to give it a try with external login, but - if I > > > > understood you right - I see a big disatvantage: > > > > > Many applications are not or should not be usable at all when the user > > > > is not logged in. But there are also applications that should be > > > > usable (in a limited way) without login. > > > > > Consider eBay: You can search and browse as nobody, but if you want to > > > > sell, you have to sign in. Or consider a chess application: You can > > > > watch everything, but if you want to create a new game, you have to > > > > sign in first. Consider a forum: You can read a lot, but not > > > > everything, but after you login, you can read everything and also > > > > write. > > > > > So my problem is that with your method I had to lock out all guest > > > > users that just want to come and see what is going on there! > > > > Not necessarily. > > > The setup I described about web.xml, etc. would make it behave as you > > > describe, but that's just one way to do "externalized login", and a > > > way that doesn't make "guest access" possible (to make things simpler > > > and keeping the advantages of container-managed login using servlet > > > FORM or JASPIC, you could just use 2 "host pages": a world-accessible > > > one and a restricted one, possible using redirections and so on to > > > make it "work as intended" in every corner case, I haven't tested; I > > > bet you'll find plenty of examples on the Web about doing guest and > > > authenticated access on the same resource in Java servlet/JSP) > > > > In every of the 3 cases you cite, I don't see a problem in reloading > > > the app when switching from unauthenticated to authenticated access > > > (if you want to keep some information around –such as your shopping > > > cart–, send it as part of the login process –or store it on the server > > > and pass some ID around–). YMMV of course (and I didn't say > > > "externalize login" is a silver bullet, you might really want/need > > > some UX that would make it impossible to use). > > > > One possibility too is to only allow a guest-to-authenticated-user > > > workflow without reloading the app ("integrated login"). As soon as > > > the user wants to sign out, then reload the app and start back in > > > "guest mode". That way, you don't have to fear about restricted data > > > "leaking" between user sessions, but you'd still have to make sure to > > > clear some client-side caches (depending on your use case; for the > > > forum case you gave, for instance, clear the list of posts so you'll > > > reload them from the server and see the "restricted posts"). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
unable to add gwt sdk
Hie gwt sdk is missing in my project and when i try to add there is a red cross on it. if i go to eclipse add new software and add it errors out saying 2.04 gwt is already installed. please advise how to resolve it. Thankx and Regards Vik Founder www.sakshum.com www.sakshum.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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: problems with auto-complete form login
On 6 sep, 19:22, George Georgovassilis wrote: > Hello Magnus, > > That's called "Breaking out of frames" [1]. If you need your app to be > able to detect a valid login, then you'll need to communicate from > within the iframe to the hosting app that the login was ok (have a > look at window.name transport in this case [2]) > > [1]http://www.blooberry.com/indexdot/html/topics/breakframe.htm > [2]http://development.lombardi.com/?p=611 In this case, a target=_top on the would be enough. But honestly, I don't understand how this design is any different from redirecting to the login page (unless maybe you have a "cancel" button that leaves you in the app, i.e. without reload) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
MVP Question
Hey guys, I have some problems with my MVP architecture. Do I have to "destroy" my old presenter instances when I´m creating a new one? For example: I´m on page A and switch to page B. After that I go back to page A and create another instance of pageApresenter with my history management. But it feels, that the old instance of my presenter runs in the background and is also affecting my actions. When I´m now fireing an event to the eventBus the event is called twice or more often if I switch another time to page B and then back to page A. My routine to create those presenters looks like this: ... Presenter contentPresenter = null; if (token.equals("adminMembersShowMembers")) { contentPresenter = new MemberListPresenter(rpcService, eventBus, new MemberListView(eventBus)); } else if ... contentPresenter.go(display.getContentContainer()); ... I would appreciate your help ;) thanks, Michael -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: MVP Question
A couple of observations: o Consider presenters as singletons o Consider Gin I'm sure others will provide additional observations. On 09/06/2010 01:10 PM, Jambi wrote: > Hey guys, > > I have some problems with my MVP architecture. Do I have to "destroy" > my old presenter instances when I´m creating a new one? For example: > > I´m on page A and switch to page B. After that I go back to page A and > create another instance of pageApresenter with my history management. I don't use history management (yet), but you shouldn't need to create a new presenter just to go to a place. > But it feels, that the old instance of my presenter runs in the > background and is also affecting my actions. When I´m now fireing an > event to the eventBus the event is called twice or more often if I > switch another time to page B and then back to page A. That's what we call a "clue" :) You probably want to deregister your handlers before switching to Page B, and reregister upon returning to page A. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Is TabLayoutPanel lazy?
Does anyone know if the "pages" for each tab in a TabLayoutPanel are created lazily, i.e. on the first selection of a given tab, or on instantiation of TabLayoutPanel? And does it make a diff if using uibinder? thanks! -r -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: MVP Question
> o Consider presenters as singletons > o Consider Gin I haven´t tried Gin till now because I try to learn step by step how MVP etc. works. I´m pretty new to programming and GWT so it´s really hard for me to try all the opportunites you have now in gwt (MVP, gin, guice, eventbus, etc). Right now, I don´t even know what even dependency injection is. But as I said, I´m trying to learn it step by step. So you would recommend Gin to solve such problems? > I don't use history management (yet), but you shouldn't need to create a > new presenter just to go to a place. So what would be the best practices to recall my presenter singleton? > You probably want to deregister your handlers before switching to Page > B, and reregister upon returning to page A. Same question here, what would be the best practice for that? I haven ´t seen something like that in the gwt mvp tutorial. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Problems with gwt plugin and eclipse
Hi, Sorry that I'm late on replying to this thread. TBirch, can you take a look at your Error Log (Window -> Show View -> Error Log), and see if there is a full stack trace listed for the error that you're describing? There may be some sort of API change that we haven't accounted for in Eclipse 3.6. My gut instinct is that 32- vs. 64-bit shouldn't matter, since the error seems to be happening in non-native code.. Thanks, Rajeev On Thu, Sep 2, 2010 at 7:43 AM, TBirch wrote: > Alex, > Thanks for your help. I've tried everything I can think of. > I will just have to continue using an older version of eclipse and the > gwt plugin for now > as they work okay on both machines. > Terry > > On Sep 1, 9:53 am, AlexG wrote: > > Hi TBirch, > > > > hmmm it really seems that something is going wrong on your > > machines. Don´t know why it isn´t working on your machine. > > > > If you have everything as 32-Bit-versions, than it should work. > > Maybe someone else had thisproblem? > > > > Greets Alex > > > > On 30 Aug., 15:25, TBirch wrote: > > > > > > > > > > > > > > > > > Hi Alex, > > > > > Thanks for your suggestion. I will check the on the jdk version on > > > that machine. > > > However, I also have a 32 bit vista machine. This morning on the 32 > > > bit machine I downloaded the helios 3.6 version of eclipse and the 3.6 > > > version of thegwtplugin. When trying to create a standardgwt > > > project I get the same error as on the 64 bit machine: > > > Errors occurred during the build. > > > Errorsrunningbuilder 'Google Web Toolkit Project Validator' on > > > project 'contacts'. > > > org.eclipse.jdt.internal.core.JavaModel cannot be cast to > > > org.eclipse.jdt.core.IJavaProject > > > > > Myproblemdoes not seem to be related to a 64 bit versus 32 issue. > > > Could there be another piece of software on both of my machines that > > > could be causing aproblem? > > > Thanks, Terry > > > > > On Aug 30, 4:52 am, AlexG > > > wrote: > > > > > > Hi TBirch > > > > > > I also had problems, ehwn I get started withGWT. > > > > I am using Windows 7 64-Bit. > > > > > > I have the followong Verison installed, and everything > > > > works fine: > > > > > > Eclipse Helios 3.6 32-Bit !! > > > > Plugins fomr the Eclipse-plugin-install-feature > > > > > > Be sure you have a Java 32-Bit JDK installed, otherwise > > > > this will nor work with Eclipse 32-Bit. > > > > > > Greets Alex > > > > > > On 29 Aug., 21:44, TBirch wrote: > > > > > > > I amrunning64 bit windows vista and for some reason I am getting > > > > > this error: > > > > > Errors occurred during the build. > > > > > Errorsrunningbuilder 'Google Web Toolkit Project Validator' on > > > > > project 'contacts'. > > > > > org.eclipse.jdt.internal.core.JavaModel cannot be cast to > > > > > org.eclipse.jdt.core.IJavaProject > > > > > > > I have tried several versions of eclipse and and the only way I > seem > > > > > to be able to create and run a standardgwtproject in eclipse is by > > > > > going back to an older version of eclipse i.e Version: > > > > > 3.5.0.v20090611a-9gEeG1HFtQcmRThO4O3aR_fqSMvJR2sJ > > > > > Build id: I20090611-1540 > > > > > > > Anyone have any suggestions as I have tried every other combination > of > > > > > 32 and 64 bit eclipse withgwtpluginI can think of. > > > > > 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-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: MVP Question
On 6 sep, 23:29, Jeff Chimene wrote: > A couple of observations: > > o Consider presenters as singletons > o Consider Gin > > I'm sure others will provide additional observations. "presenters as singletons" means you have to make sure you cleanup state between uses; "throwable" presenters are easier to code (and test) because they don't need this kind of clean-up. Not to mention that singletons eat up memory even when you no longer need them. See "a note on performance" in http://tbroyer.posterous.com/gwt-21-activities (and look at GWT 2.1's com.google.gwt.app.place.AbstractProxy*Activity –in milestones up to and including M3, they're called AbstractRecord*Activity–; Ray Ryan recently said this design was inspired by Wave where it was quite succesful). Jambi: Gin won't help you solve this particular problem, but I advise you to look at it soon, as it'll make your life so much easier! (BTW, dependency injection is a very good pattern to follow, be it managed manually or with tools such as Gin; the rule of thumb is: do not "new" objects –such as your presenters and views–, have them, or factories of them, passed to your constructor) > On 09/06/2010 01:10 PM, Jambi wrote: > > > Hey guys, > > > I have some problems with my MVP architecture. Do I have to "destroy" > > my old presenter instances when I m creating a new one? For example: > > > I m on page A and switch to page B. After that I go back to page A and > > create another instance of pageApresenter with my history management. > > I don't use history management (yet), but you shouldn't need to create a > new presenter just to go to a place. > > > But it feels, that the old instance of my presenter runs in the > > background and is also affecting my actions. When I m now fireing an > > event to the eventBus the event is called twice or more often if I > > switch another time to page B and then back to page A. > > That's what we call a "clue" :) > > You probably want to deregister your handlers before switching to Page > B, and reregister upon returning to page A. +1 So to answer Jambi's question, yes you have to "destroy" your presenter (in GWT 2.1, stopping the activity) to tell it to deregister itself from whereever it registered references to itself (which prevent it from being garbage collected). This is done by keeping handles to the HandlerRegistration returned by the addHandler calls to the event bus to be able to removeHandler() (you could also just call removeHandler on the event bus with the exact same arguments as your previous addHandler calls; note that in GWT 2.1 activities, this would be automatic, handled by the StopperedEventBus you're passed in your activity's start()) http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/event/shared/HandlerRegistration.html -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
UiBinder: ClientBundle with ImageResource & . How?
Hi Guys, I'll try to be concise :) I do *NOT* want to use an external css file. All style should be in the ui.xml... *Client Bundle:* public interface MyClientBundle extends ClientBundle { @Source("loading.gif") ImageResource loading(); } *ui.xml* .loader1 { gwt-image: ; } .loader2 { background: ; } .loader3 { margin-left: ; } *Questions:* Q: How can loader1.gwt-image be "loading.gif"? Q: How can loader2.background be "loading.gif"? Q: How can loader3.margin-left be "loading.gif.width"? Thanks Heaps :) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: UiBinder: ClientBundle with ImageResource & . How?
Seems like I can kinda answer two of these questions myself now... Q: How can loader1.gwt-image be "loading.gif"? @sprite .loader1 { gwt-image: 'loading'; padding-left: value('loading.getWidth','px'); width: auto; height: auto; } The problem with this is that if (loading.gif && MyClientBundle) are in a different package/directory to that of the ui.xml BOOM! This seems a little stupid to me, re-usablity of ClientBundles across multiple ui.xml templates is a great idea - but putting them all in the same flat package/directory structure is not. If anyone can clean this up it would be excellent. Q: How can loader3.margin-left be "loading.gif.width"? as above... padding-left: value('loading.getWidth','px'); If anyone can help with the other stuff... THANKS HEAPS. On Tue, Sep 7, 2010 at 10:46 AM, Andrew Hughes wrote: > Hi Guys, > > I'll try to be concise :) I do *NOT* want to use an external css file. All > style should be in the ui.xml... > > *Client Bundle:* > public interface MyClientBundle extends ClientBundle { > @Source("loading.gif") ImageResource loading(); > } > > *ui.xml* > > > .loader1 { > gwt-image: ; > } > .loader2 { > background: ; > } > .loader3 { > margin-left: ; > } > > > *Questions:* > > Q: How can loader1.gwt-image be "loading.gif"? > Q: How can loader2.background be "loading.gif"? > Q: How can loader3.margin-left be "loading.gif.width"? > > Thanks Heaps :) > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
reload css without reload the page
How to reload css file without reload the page? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.