delayTestFinish() from GWTTestCase not working in pure java tests

2013-10-08 Thread Derek Thurn
I'm trying to verify that some JavaScript code behaves identically to an 
existing Java library. I've created some tests that subclass GWTTestCase to 
check this. Unfortunately, when I try and do the pure-java test in 
development mode (by returning null for the module name, as the 
documentation suggests), the methods like delayTestFinish() don't appear to 
work. Tests just finish as soon as the test method exits. Is this the 
intended behavior? If so, has anybody made a pure-java implementation of 
GWTTestCase so test logic can be shared between client and server code?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: delayTestFinish() from GWTTestCase not working in pure java tests

2013-10-08 Thread Derek Thurn
That sounds promising, got a link to the tests?

On Tuesday, October 8, 2013 8:22:18 AM UTC-7, Thomas Broyer wrote:


 On Tuesday, October 8, 2013 5:08:04 PM UTC+2, Derek Thurn wrote:

 I'm trying to verify that some JavaScript code behaves identically to an 
 existing Java library. I've created some tests that subclass GWTTestCase to 
 check this. Unfortunately, when I try and do the pure-java test in 
 development mode (by returning null for the module name, as the 
 documentation suggests), the methods like delayTestFinish() don't appear to 
 work. Tests just finish as soon as the test method exits. Is this the 
 intended behavior? If so, has anybody made a pure-java implementation of 
 GWTTestCase so test logic can be shared between client and server code?


 For now at least, yes, this is the intended behavior. The RequestFactory 
 tests in GWT use JRE and GWT tests from the same base code (using 
 delayTestFinish), but JRE tests use the InProcessRequestTransport (or 
 UrlRequestTransport) which is blocking.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Web workers

2012-09-13 Thread Derek
Okay, I've looked at my code.

I modified the DedicatedWorkerTemplate.js file from speedtracer to include 
the following lines near the top (first two should already be there):

$self = self;
$sessionId = null;
$wnd = self;
$doc = self;
window = self;

This kept a lot of the code I was using that was looking for a $wnd and 
$doc variable happy. Of course, it doesn't *actually* provide window or 
document objects, it just renames them so the code doesn't blow up. This 
has been part of the problem with the project I've been working on, I'm 
using an external library that is unaware it is being used as a worker and 
while in theory it's just doing processing, it's still expecting to find 
certain values in window and document objects, so I've been slowly and 
annoyingly figuring out how to create a mock window and document object to 
accommodate the code. But it's a pain and I'm considering just rewriting 
it. Unfortunately that removes the usefulness of the library since I was 
using it to save me from coding my own implementation (and I'd have to keep 
porting over the updates as they occur, bleh). On the other hand, running 
the third-party processing in the main thread really kills the app's 
performance (especially on mobile).

Sigh. Apparently I needed to vent... Sorry about that.

Derek

On Thursday, September 13, 2012 5:15:32 AM UTC-4, Harold wrote:

 Hi Derek,

 Thanks for the advice.
 I tried to put var $wnd= $self but what about var $document ?

 if you have some time to check your code, it is welcome :)

 Regards,
 Harold

 2012/9/10 Derek derek...@gmail.com javascript:

 I'd need to look at my code again (not convenient to do right now), but I 
 recall putting something along the lines of 'var $wnd = $self' at the top 
 of the js wrapper. (i.e., editing the speedtracer code's javascript file 
 and adding those lines to the top)


 On Monday, September 10, 2012 3:59:11 AM UTC-4, Harold wrote:

 Hi Derek,

 As i have a lot of JSNI calls, i do not use the dev mode.
 Super dev mode is far more suitable !

 Btw, i still have issue with my worker because after GWT compilation, 
 the generated script contains window and document variables which are 
 not defined in the worker scope, so i get an error at worker start.

  function myworker(){
  ...
 var $wnd = window, $doc = document ...
 ...


 How do you say to GWT to ignore window things ?
 I have read that we should use $self instead of $window but i do not 
 know how to configure GWT compiler.

 Regards,
 Harold


 2012/9/9 Derek derek...@gmail.com

 I've played around with web workers on GWT, but it's not a lot of fun. 
 You can't use normal GWT devmode on them (though maybe superdevmode would 
 work?). So you essentially have to write the worker, compile it, and then 
 call it from your non-worker code and hope it does what you want.


 On Saturday, September 8, 2012 3:58:30 PM UTC-4, Harold wrote:

 Hi all,

 Does anyone have used web workers via GWT ? 

 I have tried to use web workers looking at speed tracer code :
 http://code.google.com/p/**speed**tracer/source/browse/#**svn%**
 2Ftrunk%2Fsrc%2Fclient%**2Fui%**2Fsrc%2Fcom%2Fgoogle%**2Fgwt%**
 2Fwebworker%253Fstate%**253Dclos**edhttp://code.google.com/p/speedtracer/source/browse/#svn%2Ftrunk%2Fsrc%2Fclient%2Fui%2Fsrc%2Fcom%2Fgoogle%2Fgwt%2Fwebworker%253Fstate%253Dclosed
  
 But i did not succeed to launch my worker.

 Is there any example anywhere ?

 Regards,
 Harold




 -- 
 *Small WebGL 3D engine for GWT*
 *http://code.google.com/p/ethereal-engine/*http://code.google.com/p/ethereal-engine/
  
  
  -- 
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-web-toolkit/-/u65cj3jpGssJ.

 To post to this group, send email to 
 google-we...@googlegroups.comjavascript:
 .
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com javascript:.
 For more options, visit this group at 
 http://groups.google.com/group/google-web-toolkit?hl=en.




 -- 
 *Small WebGL 3D engine for GWT*
 *http://code.google.com/p/ethereal-engine/*http://code.google.com/p/ethereal-engine/
  
  

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/uADQDjj9cvcJ.
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 workers

2012-09-10 Thread Derek
I'd need to look at my code again (not convenient to do right now), but I 
recall putting something along the lines of 'var $wnd = $self' at the top 
of the js wrapper. (i.e., editing the speedtracer code's javascript file 
and adding those lines to the top)

On Monday, September 10, 2012 3:59:11 AM UTC-4, Harold wrote:

 Hi Derek,

 As i have a lot of JSNI calls, i do not use the dev mode.
 Super dev mode is far more suitable !

 Btw, i still have issue with my worker because after GWT compilation, the 
 generated script contains window and document variables which are not 
 defined in the worker scope, so i get an error at worker start.

  function myworker(){
  ...
 var $wnd = window, $doc = document ...
 ...


 How do you say to GWT to ignore window things ?
 I have read that we should use $self instead of $window but i do not know 
 how to configure GWT compiler.

 Regards,
 Harold


 2012/9/9 Derek derek...@gmail.com javascript:

 I've played around with web workers on GWT, but it's not a lot of fun. 
 You can't use normal GWT devmode on them (though maybe superdevmode would 
 work?). So you essentially have to write the worker, compile it, and then 
 call it from your non-worker code and hope it does what you want.


 On Saturday, September 8, 2012 3:58:30 PM UTC-4, Harold wrote:

 Hi all,

 Does anyone have used web workers via GWT ? 

 I have tried to use web workers looking at speed tracer code :
 http://code.google.com/p/**speedtracer/source/browse/#**
 svn%2Ftrunk%2Fsrc%2Fclient%**2Fui%2Fsrc%2Fcom%2Fgoogle%**
 2Fgwt%2Fwebworker%253Fstate%**253Dclosedhttp://code.google.com/p/speedtracer/source/browse/#svn%2Ftrunk%2Fsrc%2Fclient%2Fui%2Fsrc%2Fcom%2Fgoogle%2Fgwt%2Fwebworker%253Fstate%253Dclosed
  
 But i did not succeed to launch my worker.

 Is there any example anywhere ?

 Regards,
 Harold




 -- 
 *Small WebGL 3D engine for GWT*
 *http://code.google.com/p/ethereal-engine/*http://code.google.com/p/ethereal-engine/
  
  

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/u65cj3jpGssJ.
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 workers

2012-09-09 Thread Derek
I've played around with web workers on GWT, but it's not a lot of fun. You 
can't use normal GWT devmode on them (though maybe superdevmode would 
work?). So you essentially have to write the worker, compile it, and then 
call it from your non-worker code and hope it does what you want.

On Saturday, September 8, 2012 3:58:30 PM UTC-4, Harold wrote:

 Hi all,

 Does anyone have used web workers via GWT ? 

 I have tried to use web workers looking at speed tracer code :

 http://code.google.com/p/speedtracer/source/browse/#svn%2Ftrunk%2Fsrc%2Fclient%2Fui%2Fsrc%2Fcom%2Fgoogle%2Fgwt%2Fwebworker%253Fstate%253Dclosed
  
 But i did not succeed to launch my worker.

 Is there any example anywhere ?

 Regards,
 Harold


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/C4M07sUMoFsJ.
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: Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-28 Thread Derek
Hi Seth,

I personally am not a fan of Spring. I'm generally not a fan of anything 
that says, First, create a bunch of XML files (GWT excepted :) ). That's 
why I gravitated to Guice for all my DI needs. That said, Guice and Spring 
aren't quite the same thing, and you could leverage both of them.

However, it is probably unnecessary to do both Guice and Spring in a GWT 
app. You can do anything with one DI framework that you can do with the 
other, and if you are leaning to Spring, you make a fine choice and you can 
ignore the rest of my post.

At my workplace, the way we do GWT projects is we create a WebXml.java in 
the server package that implements GuiceServletContextListener and point 
the web.xml to that class. The WebXml contains servlet mapping modules, db 
connection modules, and other Guice modules as needed.

On the client side, we generally use MVP structure with GIN. The MVP 
structure is a lifesaver for large projects in my mind. Our more recent 
projects have used the Activity and Places framework described on GWT's 
website with the main exception that the ClientFactory object is 
unnecessary since GIN provides the various resources instead of 
ClientFactory.

At my work we've got two projects that clock in around 34k and 46k lines of 
Java (not including XML or other artifacts) as well as smaller projects and 
they use the methodology I described.

Derek

On Monday, August 27, 2012 5:18:13 PM UTC-4, GWTter wrote:

 Hi Derek,

 Thanks a lot for the reply. I did consider Guice for DI on the serverside 
 but not sure if it would be redundant if using a framework like Spring. I 
 do want to utilize RF though as it has a nice set of features which I'd 
 like to include, e.g. caching and only delta posts. And I'll definitely 
 take a look at GIN again since DI on my clientside might be pretty nice 
 too. Thanks again,

 -Seth

 On Monday, August 27, 2012 4:05:05 PM UTC+2, Derek wrote:

 I use Guice on the server side and GIN on the client side. I generally 
 use DTOs over GWT-RPC since RequestFactory isn't what I need / want to 
 migrate to.

 On Saturday, August 25, 2012 7:48:12 PM UTC-4, GWTter wrote:

 Hi all,

 I've been doing research on this for the past 2, almost 3 days now. I 
 feel like I've googled everything under the sun on the matter (including 
 these forums) and am almost all tutorialed-out. Before I go into any more 
 details on the question I just want to give a quick overview of the scope 
 and plan for the project to see what will suit it best:

 -Large application, non-trivial
 -50+ DB tables
 -Large user base
 -User management/authentication/sessions
 -transactions
 -security
 -MVP (as per GWT recommendation)
 -focus on performance and scalability (naturally :), am using GWT after 
 all)

 I've also read and watched all of the best practices on architecture for 
 large applications (Google/GWT).

 Now in the last talk I could find on best architecture practices 
 involving GWT was back in 2010 by Ray Ryan in which he states that they 
 don't think JavaBeans and property change events work terribly well so it's 
 better to use DTOs for the Model.

 My big questions are if this is still the belief and the recommended 
 route, and if so, what should I be looking at in order to achieve this? a 
 Framework?

 My preference would be to keep coding in Java on the serverside since 
 I'm already doing so with GWT on the client. I've been investigating 
 serverside frameworks and seem to have arrive at 2: Seam or Spring? However 
 I can figure out which of these are best suited for the task. All of the 
 doc I've found out there discussing the issue is at the most recent about a 
 year old but most of it is from =2010 so it makes it even harder to tell 
 considering that both of these frameworks have evolved considerably since 
 then. There's also been the coming of JEE 6.

 Can anyone give any insight on who's best suited for the task, or what I 
 should do to fulfill my requirements but stay inline with what is 
 recommended by GWT? I know I only mentioned Seam and Spring since that's 
 what I've been led to mostly, but I'm open to any suggestions that fit what 
 I'm looking for. I've already ruled a couple of solutions such as Spring 
 Roo for this kind of task.

 This is my first project of this scale and the last thing I want to do 
 is head down a path and figure out that I've wasted a lot of my and my 
 team's time and energy because of some wrong decisions I made at the get-go.

 Thanks a lot in advance for your help, I really just want to figure this 
 out so I can get back to coding instead of googling the ends of the earth 
 ;).

 -Seth



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/mrQWtLJt_W8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email

Re: Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-27 Thread Derek
I use Guice on the server side and GIN on the client side. I generally use 
DTOs over GWT-RPC since RequestFactory isn't what I need / want to migrate 
to.

On Saturday, August 25, 2012 7:48:12 PM UTC-4, GWTter wrote:

 Hi all,

 I've been doing research on this for the past 2, almost 3 days now. I feel 
 like I've googled everything under the sun on the matter (including these 
 forums) and am almost all tutorialed-out. Before I go into any more details 
 on the question I just want to give a quick overview of the scope and plan 
 for the project to see what will suit it best:

 -Large application, non-trivial
 -50+ DB tables
 -Large user base
 -User management/authentication/sessions
 -transactions
 -security
 -MVP (as per GWT recommendation)
 -focus on performance and scalability (naturally :), am using GWT after 
 all)

 I've also read and watched all of the best practices on architecture for 
 large applications (Google/GWT).

 Now in the last talk I could find on best architecture practices involving 
 GWT was back in 2010 by Ray Ryan in which he states that they don't think 
 JavaBeans and property change events work terribly well so it's better to 
 use DTOs for the Model.

 My big questions are if this is still the belief and the recommended 
 route, and if so, what should I be looking at in order to achieve this? a 
 Framework?

 My preference would be to keep coding in Java on the serverside since I'm 
 already doing so with GWT on the client. I've been investigating serverside 
 frameworks and seem to have arrive at 2: Seam or Spring? However I can 
 figure out which of these are best suited for the task. All of the doc I've 
 found out there discussing the issue is at the most recent about a year old 
 but most of it is from =2010 so it makes it even harder to tell 
 considering that both of these frameworks have evolved considerably since 
 then. There's also been the coming of JEE 6.

 Can anyone give any insight on who's best suited for the task, or what I 
 should do to fulfill my requirements but stay inline with what is 
 recommended by GWT? I know I only mentioned Seam and Spring since that's 
 what I've been led to mostly, but I'm open to any suggestions that fit what 
 I'm looking for. I've already ruled a couple of solutions such as Spring 
 Roo for this kind of task.

 This is my first project of this scale and the last thing I want to do is 
 head down a path and figure out that I've wasted a lot of my and my team's 
 time and energy because of some wrong decisions I made at the get-go.

 Thanks a lot in advance for your help, I really just want to figure this 
 out so I can get back to coding instead of googling the ends of the earth 
 ;).

 -Seth


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/OOH7j5_J5-kJ.
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: Elemental in GWT 2.5 is what?

2012-07-10 Thread Derek

On Tuesday, July 10, 2012 9:47:56 AM UTC-4, Thomas Broyer wrote:


 Not having permutations per UA is not only a compile-time thing, it also 
 means you don't have to sniff the UA at runtime, so there's no risk of 
 false-positives or false-negatives (
 http://code.google.com/p/google-web-toolkit/issues/detail?id=2938, 
 http://code.google.com/p/google-web-toolkit/issues/detail?id=5278, 
 http://code.google.com/p/google-web-toolkit/issues/detail?id=6665) and 
 supporting a new browser (
 https://groups.google.com/d/topic/es-operating-system/8oWtRZnDK_w/discussion) 
 comes for free.


The goal is to only have a single permutation? I thought the multiple 
permutation system of GWT was only good (though admittedly I have been 
burned by IE9 and 10). Isn't it preferable to not send 
-moz-linear-gradient(...) to Chrome and -webkit-linear-gradient(...) to 
Firefox? (Same with mozIndexedDB vs webkitIndexedDB.) I thought this made 
the code smaller and better tailored than the this or this or this style 
of coding.

Also, assuming I go this route, how do I tell GWT to just do one 
permutation without UA concerns? I've been working on an app that I was 
originally only targeting webkit for (thus set-property name=user.agent 
value=safari/), but nothing in it should necessarily have broken in 
Firefox (besides the WebSQL stuff). So I decided to point Firefox to it, 
and immediately got an alert saying Firefox wasn't supported, despite the 
app working well enough. Obviously it was easy to fix by adding gecko1_8 to 
set-property, but how do I create the one permutation to rule them all that 
doesn't complain?
 

 Again I'm not questioning Elemental utility greatness, but so far it looks 
 to be much more important to GWT internally than to the rest of us, mere 
 GWT consumers.


 Everyone has different needs.

 
I'm very happy to be able to use Elementals to use a new Web API without 
having to hand-generate the overlays myself. (Haven't actually sat down to 
play with it yet, but I'm excited.)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/fLWF8JlAGsEJ.
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: Google Web Toolkit : Tree.addTreeListener is deprecated what should I use instead.

2012-07-10 Thread Derek
The API docs are normally pretty good about giving you the alternative:

http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Tree.html#addTreeListener(com.google.gwt.user.client.ui.TreeListener)

*Deprecated.* *Use 
addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler)http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Tree.html#addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler)
,addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler)http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Tree.html#addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler),
 
andaddCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Tree.html#addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)
 instead*

On Friday, July 6, 2012 2:28:20 PM UTC-4, laurence Turpin wrote:

 Hello, 

 I'm learning about the Google web toolkit from the book Beginning Google 
 Web Toolkit 
 I have got to the part where it starts using a Tree widget. 
 It uses Tree.addTreeListener() which apparently is now deprecated. 
 I can't work out what to use instead. 

 There is a class called Category and I'm creating a tree of Category. 

 The method below is where the problem is: 

 view 
 plainhttp://www.coderanch.com/t/586280/GUI/java/Google-Web-Toolkit-Tree-addTreeListener#copy
  
 to 
 clipboardhttp://www.coderanch.com/t/586280/GUI/java/Google-Web-Toolkit-Tree-addTreeListener#
 printhttp://www.coderanch.com/t/586280/GUI/java/Google-Web-Toolkit-Tree-addTreeListener#
 ?http://www.coderanch.com/t/586280/GUI/java/Google-Web-Toolkit-Tree-addTreeListener#

1.  protected Widget createCategoriesWidget() {  
2. Tree categoryTree = new Tree();  
3. categoryTree.setWidth(100%);  
4. categoryTree.addTreeListener(new TreeListener() {  
5.   public void onTreeItemSelected(TreeItem item) {  
6. selectedCategory = ((CategoryTreeItem)item).getCategory();  
7. updateTasksList();  
8.   }  
9. });  
10.   
11. ListCategory categories = getAllCategories();  
12. for (final Category category : categories) {  
13.   CategoryTreeItem item = createTreeItem(category);  
14.   categoryTree.addItem(item);  
15. }  
16. return categoryTree;  
17.   }  

 Does anyone know how to rewrite this method so it isn't deprecated?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Oi6iYvMXB5kJ.
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 Web Workers - multiple modules on same page

2012-06-15 Thread Derek
I am trying to use GWT Web Workers (code based on the speedtracer Web 
Worker implementation), but I am not able to make the worker module 
participate in dev mode, requiring me to recompile the worker every time I 
change code in it. Has anyone else worked on this code and dealt with this 
problem?

When I create a separate module for my web worker and try to run my code, I 
get the error alert is not defined because the permutation is not created 
and the worker is trying to run alert(Module 'myworker' may need to be 
(re)compiled), which fails since workers don't have access to window.alert.

If I compile the worker module, I get a permutation created which is served 
up correctly when my main module tries to load the worker at 
../myworker/myworker.nocache.js. No errors, everything seems to work 
correctly, but the myworker module is not participating in dev mode despite 
my main module participating. So I can modify the code that calls the 
workers in dev mode, but any changes to the workers requires a recompile of 
the worker module.

Is there a way to make the worker work with the code server? The Worker 
linker is based on a SelectionScriptLinker, but I'm not sure if it's the 
linker that's refusing to generate a dev mode permutation, or the code 
server, or dev mode, or what.

Has anyone dealt with this problem? Does anyone have any ideas?

Thanks,
Derek

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/aB9Ncefh-DkJ.
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: Firefox 13 DevMode Plugin

2012-06-07 Thread Derek
Alan,

Is it possible to build dev mode for Firefox for Android?

On Jun 7, 3:29 am, Alan Leung acle...@google.com wrote:
 http://acleung.com/ff13-linux32.xpi

 Everything seems to work now. Will post the rest tomorrow.

 -Alan







 On Wed, Jun 6, 2012 at 4:29 PM, Alan Leung acle...@google.com wrote:

  BTW Alan, would you mind sharing what the issues are?

  Ah ah! I think we are safe. The root problem was that they changed the
  layout of JSClass. At first I though it was something more serious. I feel
  that most of the SpiderMonkey changes were not documented in this release.
  :(

  Anyways, I should make them available soon.

  -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: Generate URL to image stored on server

2012-06-07 Thread Derek
Because you need to use GWT.getHostPageBaseURL() not
GWT.getModuleBaseURL() (or use modulebase, but prepend ../ to your
filename). I assume the actual url to get the image is
http://127.0.0.1:/card_designer/exampleImage.jpg . That should get
the image.

BUT, going back to the working directory thing, it IS problematic to
write files there. At least, it is if you expect those files to be
there long term. Every time you redeploy a war in production, your app
server (tomcat, glassfish, whatever) will overwrite everything in the
directory which will erase working directories like card_designer. If
you just need some temporary space to store an image while the user
does things like cropping the image and then they download the
finished product, then that might be fine. But if they expect that url
to work long term, I wouldn't use that space.

(Also, don't know if you've considered the problem of lots of people
uploading images named the same thing or not.)

I recently had to do something similar to what you did. We have a
directory mounted on our production servers that holds uploaded images
(and isn't accessible via the web). When someone uploads a file, I
check the MD5 hash of the file to see if it's a match of another image
(in my use case, it's very probable that a user will upload the same
image or images every time they use the app). If it's not, then I
write the file to the shared directory in the MD5hash.ext format.
Either way, I then return the calculated filename to the GWT code.

The GWT code then immediately executes a request to a servlet hosted
at /mymodule/images/* and uses the path info to get the filename and
goes to look it up in the shared directory and relays the data through
the servlet.

Hope that's all clear enough.

Derek

On Jun 6, 12:09 pm, Gary garyker...@googlemail.com wrote:
 That makes sense. I have changed the location of storage to be the working
 directory:

 public static File dataDirectory = new File(card_designer);

 I prepend this File to each new File I open. So now I just need to
 construct a URL to grab these images.

 I have tried:

 public static String accessURL = GWT.getModuleBaseURL();

 On constructing an Image widget for my dynamic images, I append the
 relative filepath to this accessURL, as so:

 Image example = accessURL + card_designer/exampleImage.jpg;

 However, I get a 404 file not found in my console on development mode:

 404 - GET
 //http://127.0.0.1:/carddesigner/card_designer/exampleImage.jpg
 (127.0.0.1) 1444 bytes

 I think I'm close, but I don't understand why the GET request fails. The
 images is right there on the disk.







 On Wednesday, June 6, 2012 3:24:53 PM UTC+1, Piro wrote:

  I don't think you can access files in this manner. If it would be possible
  it would mean you can access any file on server(no security).

  What you have to do is to store the file anywhere and generate some sort
  of ID for it. Then you need to implement HTTP GET request by servlet.
  Servlet will need to map ID to file location and write file to response
  (and set some things like content type).

  Iam sure there are other ways (REST,...).
  Piro

-- 
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: convert dom element to widget

2012-06-06 Thread Derek
If your dom elements are all of a particular type that has a GWT
analog, you can possibly wrap them using a convenience wrap() method.
For example, if they're all a elements, you can wrap them with
Anchor.wrap(element).

If you have a diverse (or unrepresented) group of elements, you should
just be able to run this code:

Widget w = new Widget();
w.setElement(element);


Derek

On Jun 6, 6:46 am, Dennis Haupt d.haup...@googlemail.com wrote:
 i am trying to write a function which generically collections dom elements
 and adds them to complexpanels. i can get the dom elements, but how do i
 add them to panels? panels need widgets. is there a way to convert them?

-- 
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: Generate URL to image stored on server

2012-06-06 Thread Derek
Not sure what you mean by out-with, but I'll assume you mean you
upload it to what would be the war folder in a GWT project. If that's
true, use GWT.getHostPageBaseURL()+image.png to get the URL.

Derek

On Jun 6, 5:09 am, Gary garyker...@googlemail.com wrote:
 Hi,

 my application has a mechanism allowing a user to upload an image. This
 image is then stored on the server's disk. The important point to note is
 that the image is *out-with* the deployed WAR file.

 How do I generate a URL to access the image that has been uploaded? I want
 to return this URL after the upload is complete, so that I can construct an
 image widget around 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.



Re: zero width widgets

2012-05-25 Thread Derek
I suspect this is from mixing layoutpanels with non-layoutpanels. By
and large, layoutpanels (anything with LayoutPanel as part of its
name) need to form an unbroken chain with a previous layoutpanel all
the way back to RootLayoutPanel. If you have an HTMLPanel or
simplepanel or other non-layoutpanel between layoutpanels, the inner
layoutpanel will be sized to zero unless you explicitly set its width
and height.

On May 25, 7:59 am, Matthew Pocock turingatemyhams...@gmail.com
wrote:
 Hi,

 I seem to have recurrent problems with building up gwt layouts where things
 don't appear, and when I dig into the elemnt tree in chrome, I find that
 things are getting a zero width. Is there a standard cheat list I should be
 going through to debug these kind of issues?

 Thanks,

 Matthew

 --
 Dr Matthew Pocock
 Integrative Bioinformatics Group, School of Computing Science, Newcastle
 University
 mailto: turingatemyhams...@gmail.com
 gchat: turingatemyhams...@gmail.com
 msn: matthew_poc...@yahoo.co.uk
 irc.freenode.net: drdozer
 skype: matthew.pocock
 tel: (0191) 2566550
 mob: +447535664143

-- 
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: making Anchor look like a normal link

2012-05-17 Thread Derek
I set href to javascript:;. You could instead use CSS to style the
cursor to be a pointer to make it look real, but javascript:; is the
quickest and easiest.

Derek

On May 17, 7:40 am, Matthew Pocock turingatemyhams...@gmail.com
wrote:
 Hi,

 I have several g:Anchor elements in my UiBinder design. I attach OnClick
 handlers to these to do interesting things. In the browser, these anchors
 are being rendered as a elements lacking an href attribute. When the
 mouse hovers over them, they don't do the usual link display things - the
 mouse icon goes into text mode rather than link-follow mode, and there's no
 blue underline. I tried adding a dummy href= attribute, but although now
 they look like normal links, clicking on them follows to the url (in this
 case, a boring one) instead of the click handler. I want to have my cake
 and eat it - I want these links to look like links but react with my click
 handler. Is there a trick for this?

 Thanks,

 Matthew

 --
 Dr Matthew Pocock
 Integrative Bioinformatics Group, School of Computing Science, Newcastle
 University
 mailto: turingatemyhams...@gmail.com
 gchat: turingatemyhams...@gmail.com
 msn: matthew_poc...@yahoo.co.uk
 irc.freenode.net: drdozer
 skype: matthew.pocock
 tel: (0191) 2566550
 mob: +447535664143

-- 
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.



Error with the web application starter project

2012-05-15 Thread Derek Fountain
I'm trying to get the Getting Started guide running from this page:

https://developers.google.com/web-toolkit/usingeclipse

Running Eclipse on Linux, it works in developer mode. The compile completed 
successfully too, so I copied the contents of the 'war' directory to the 
doc root of Apache on my local box. When I access it at:

http://localhost/GWT_Example.html

the front page loads, but when I click the Send to server button the 
dialog pops up with:

*Sending name to the server:*
GWT User

*Server replies:*
An error occurred while attempting to contact the server. Please check your 
network connection and try again.

Checking the apache error log I find:

[Tue May 15 09:56:55 2012] [error] [client 127.0.0.1] File does not exist: 
/var/www/gwt_example/greet, referer: http://localhost/GWT_Example.html

Sure enough there isn't a file called greet.

I must have missed something fundamental, but since this is my first hour 
with GWT I have no idea what I might be. :o} Can someone point?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/ODMvI8EeTRsJ.
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: Error with the web application starter project

2012-05-15 Thread Derek
greet isn't a file, it's a servlet endpoint. Your GreetingServiceImpl
class is mapped to that endpoint in your web.xml file (under the war/
WEB-INF folder).

So I'd check your web.xml file and your GreetingServiceImpl class.
Make sure the classnames match, make sure the compiled class (under
WEB-INF/classes) is there, check the deploy logs.

Actually, I notice that you just said Apache. Do you have tomcat (or
other Java app server) configured correctly? Apache can't serve
servlets without some help.

Hope that helps,
Another Derek

On May 14, 10:31 pm, Derek Fountain de...@scratters.com wrote:
 I'm trying to get the Getting Started guide running from this page:

 https://developers.google.com/web-toolkit/usingeclipse

 Running Eclipse on Linux, it works in developer mode. The compile completed
 successfully too, so I copied the contents of the 'war' directory to the
 doc root of Apache on my local box. When I access it at:

 http://localhost/GWT_Example.html

 the front page loads, but when I click the Send to server button the
 dialog pops up with:

 *Sending name to the server:*
 GWT User

 *Server replies:*
 An error occurred while attempting to contact the server. Please check your
 network connection and try again.

 Checking the apache error log I find:

 [Tue May 15 09:56:55 2012] [error] [client 127.0.0.1] File does not exist:
 /var/www/gwt_example/greet, referer:http://localhost/GWT_Example.html

 Sure enough there isn't a file called greet.

 I must have missed something fundamental, but since this is my first hour
 with GWT I have no idea what I might be. :o} Can someone point?

-- 
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: Dynamic CompositeCell

2012-04-27 Thread Derek
I personally would just create a new cell, but I'd probably start with
CompositeCell for a starting point.

On Apr 25, 9:16 pm, Aoxiang Cui cuiaoxi...@google.com wrote:
 The title is too short, let me explain and simplify my situation.

 Say, I have a dto which contains a list of Booleans. I need a column whose
 cell looks like below:

 item_1  checkbox_1
 item_2  checkbox_2
 ...
 item_n  checkbox_n

 If n is a fixed number, it is fine to use CompositeCell. The problem is we
 don't know the size of list and each cell can have different list size.
 Is there any way to extend CompositeCell so as to make it support my
 situation. Or maybe I should write a new Cell?

-- 
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: For gin+code splitting,why will how to call injector's method affect splitting result?

2012-04-16 Thread Derek
I'm not entirely sure of your questions at the end, but it looks like
you're not using AsyncProvider the way it's intended and that might be
causing your problems.

AsyncProvider does not need to be bound to an implementation.
AsyncProvider should be managed by Gin.

public class MyModule extends AbstractGinModule {
 protected void configure()
  {
 bind(Widget1.class).to(Widget1Impl.class);
  }
}

@GinModules(MyModule.class)
public interface MyGinjector extends Ginjector {
   AsyncProviderWidget1 getWidget1();
}

public class CodeSplit implements EntryPoint
{
MyGinjector gin = GWT.create(MyGinjector.class);
public void onModuleLoad()
{
RootPanel.get().add(new Button(Load, new ClickHandler() {
public void onClick(ClickEvent event) {
   gin.getWidget1().get(new AsyncCallbackWidget1() {
   public void onFailure(Throwable caught) {}
   public void onSuccess(Widget1 result) {
   RootPanel.get().add(result);
   }
   });
}
}));
 }
 }

Hope that helps,
Derek

On Apr 14, 10:52 am, Alex Luya alexander.l...@gmail.com wrote:
 /Codes

 //Sub-Module1  injector
 @GinModules(M1Module.class)
 public interface M1Injector extends Ginjector
 {
     Widget1 getWidget1();}

   //module
 public class M1Module extends AbstractGinModule
 {
   @Override
   protected void configure()
   {
      bind(Widget1.class).to(Widget1Impl.class);
   }}

 //AsyncProvider
 public class M1InjectorProvider implements AsyncProviderM1Injector
 {
    public void get(final AsyncCallbackM1Injector asyncCallback)
    {
     GWT.runAsync(new RunAsyncCallback()
     {
         public void onSuccess()
         {

 asyncCallback.onSuccess((M1Injector)GWT.create(M1Injector.class));
         }

         public void onFailure(Throwable ex)
         {
             asyncCallback.onFailure(ex);
         }
     });}
 }

 public interface Widget1 extends IsWidget
 {

 }

 public class Widget1Impl extends Composite implements Widget1
 {
     private static Widget1ImplUiBinder uiBinder =
 GWT.create(Widget1ImplUiBinder.class);
     interface Widget1ImplUiBinder extends UiBinderWidget, Widget1Impl
     {
     }

     public Widget1Impl()
     {
        initWidget(uiBinder.createAndBindUi(this));
     }}

 //Sub-Module 2 Same pattern as above,just copy them and replace 1 with 2

  //Global Module
  @GinModules(Module.class)
  public interface Injector extends Ginjector
  {
   static final Injector INSTANCE = GWT.create(Injector.class);
   AsyncProviderM1Injector getM1InjectorProvider();
   AsyncProviderM2Injector getM2InjectorProvider();
  }

  public class Module extends AbstractGinModule
   {
     @Override
     protected void configure()
     {
       bind(new TypeLiteralAsyncProviderM1Injector()
 {}).to(M1InjectorProvider.class);
       bind(new
 TypeLiteralAsyncProviderM2Injector(){}).to(M2InjectorProvider.class);
     }
  }

 public class CodeSplit implements EntryPoint
 {
     /**
     * This is the entry point method.
      */
     private FlowPanel container;
     private M1Injector mi;
     private M2Injector m2i;
     private Injector injector = GWT.create(Injector.class);
     private Button bt;

     public void onModuleLoad()
     {
     container = new FlowPanel();
     container.add(bt = new Button(Load, new ClickHandler()
     {

         @Override
         public void onClick(ClickEvent event)
         {
             doSomething();
         }
     }));
     RootPanel.get().add(container);

 }

 private void doSomething()
 {
     if (container.getWidgetCount() == 1)
     {
         if (mi == null)
         {
             injector.getM1InjectorProvider().get(new
 AsyncCallbackM1Injector()
             {

                 @Override
                 public void onFailure(Throwable caught)
                 {
                     // HP Auto-generated method stub

                 }

                 @Override
                 public void onSuccess(M1Injector result)
                 {
                     mi = result;
                     doSomething();
                 }
             });
             injector.getM2InjectorProvider().get(new
 AsyncCallbackM2Injector()
             {

                 @Override
                 public void onFailure(Throwable caught)
                 {
                     // HP Auto-generated method stub

                 }

                 @Override
                 public void onSuccess(M2Injector result)
                 {
                      m2i = result;
                     doSomething();
                 }
             });
         } else
         {
             bt.setText(Unload);
             container.add(mi.getWidget1());
             container.add(m2i.getWidget2());
         }
     } else
     {
         bt.setText(Load);
         container.remove(1);
     }
      }
  }
 And What confuse me is: if comments these two:

         container.add(mi.getWidget1

Re: does any Breedcrumb widget in gwt 2.4?

2012-03-29 Thread Derek
Unfortunately, the code relies on our homegrown MVP framework and GIN,
so it's not really designed to be copy and pasted whole.

Derek

On Mar 28, 10:50 am, tong123123 tong123...@gmail.com wrote:
 Oh, would you mind to share the code?







 On Wednesday, March 28, 2012 1:27:35 PM UTC+8, mukarev wrote:

  I didn't find a breadcrumb too. So I had to build one on my own

-- 
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: does any Breedcrumb widget in gwt 2.4?

2012-03-28 Thread Derek
I used a tablayoutpanel for my breadcrumb bar in a project where i
needed breadcrumbs. just style the tabs to be plain text.

On Mar 27, 11:11 am, tong123123 tong123...@gmail.com wrote:
 anyone know?







 On Friday, March 16, 2012 2:52:30 PM UTC+8, tong123123 wrote:

  Hi,

  is there Breedcrumb control provided in GWT 2.4?
  I see a link in

 http://code.google.com/p/gwt-examples/source/browse/trunk/Core/src/or...
  but it has not download link and no related example of how to use it.

  I just think is there any official Breedcrumb widget in GWT?
  the format is just simple
   menu1  menu 1.1  menu 1.1.2
  and user can go back to menu 1.1 by clicking the menu 1.1 in the
  Breedcrumb control.

 On Friday, March 16, 2012 2:52:30 PM UTC+8, tong123123 wrote:

  Hi,

  is there Breedcrumb control provided in GWT 2.4?
  I see a link in

 http://code.google.com/p/gwt-examples/source/browse/trunk/Core/src/or...
  but it has not download link and no related example of how to use it.

  I just think is there any official Breedcrumb widget in GWT?
  the format is just simple
   menu1  menu 1.1  menu 1.1.2
  and user can go back to menu 1.1 by clicking the menu 1.1 in the
  Breedcrumb control.

-- 
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: base64 to image in gwt client

2012-03-16 Thread Derek
When I needed to do that, I just copied and pasted the code out of
GWT's ClientBundle image stuff:

private String toBase64(byte[] data) {
// This is bad, but I am lazy and don't want to write _another_
encoder
sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
String base64Contents = enc.encode(data).replaceAll(\\s+, );
return data:image/jpeg;base64, + base64Contents;
}

(And I don't have to worry about IE since we were able to convince
management that IE users could install ChromeFrame!)

On Mar 16, 4:41 am, Amruta Deshpande amv...@gmail.com wrote:
 I have a image in form of byte array on my server. I m encoding it
 with base64 as follows

     byte[] bytes = bos.toByteArray();
     String base64 =
 com.google.gwt.user.server.Base64Utils.toBase64(bytes);
     base64 = data:image/jpg;base64,+base64;

 I am using GWT on client side. I want to display this image and trying
 to build image object follws:

     public void setInput(DataSource input) {
         Image image = new Image(myUser.getImg());
         this.setWidget(i, 4, image);
     }

 but this is not working... can somebody help me?

-- 
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: loading an image

2012-01-11 Thread Derek
GWT.getHostPageURL()+imageRetriever

Javadocs suggest using getModuleBaseURL() instead of getHostPageURL(),
so that would be GWT.getModuleBaseURL()+../imageRetriever, but in
the absence of cross-site loading, I don't think it makes much
difference.

Derek

On Jan 11, 4:51 am, tanteanni tantea...@hotmail.com wrote:
 As assumed you were right: the called image url is somthing like this
 /imageRetriever?[some Parameters] (its a simple HttpServlet). So in hosted
 and webmode if i add /imageRetirever... to Url in Browser the Image is
 displayed fine. But as you said in WebMod the Url contains a
 myProject-Part. But how to fix this?

-- 
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: loading an image

2012-01-10 Thread Derek
I'd be surprised if that's related to GWT, but maybe I'm wrong.

Are you sure you're using the right URL? If you're using a relative
path, you might get tripped up between hosted and compiled mode. If
you're using the url /myimage.png, then hosted mode will probably
work and real mode would probably fail (assuming you set up your
servlet as /myimage.png), since real mode would probably actually be
at /myproject/myimage.png or something like that.

I would grab some developer tools and inspect your image source and
make sure that the url it's going to actually works. Also look for any
other errors that might be on the console.

Hope that helps,

Derek

On Jan 10, 3:35 am, tanteanni tantea...@hotmail.com wrote:
 thx,

 but my problem is, that it fails outside hosted mode. in hosted mode the
 image is loading, in real mode the small destroyed image icon appears (that
 appears in browser if image is not available) at the moment i press the
 button to load the image. and as i said before: if i load the image url
 directly the image loads fine.

-- 
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: loading an image

2012-01-09 Thread Derek
The loadhandler won't fire until the image is added to the DOM. So for
example, you could put view.setImage(image) outside the loadhandler,
and GWT.log(loaded!) inside the loadhandler, and then you should see
loaded! in your dev console.

But a loadhandler is not required for loading an image, it's only if
you want to respond to the image being loaded. For example, I'm
working on a GWT app that shows a progress bar until an image gets
loaded, and for that code, I put in a loadhandler on the image that
removes the progress bar in the onLoad() (and I also have an
errorhandler that displays a message and remove the progress bar if
the image fails to get loaded). But if you just want to load an image,
you only need to set the source and add it to the page and it will
load.

I don't actually see anything wrong with your first attempt. Why did
it fail outside of hosted mode?

If you want to load your image ahead of time so it displays
immediately, try Image.prefetch(url).

On Jan 9, 7:40 am, tanteanni tantea...@hotmail.com wrote:
 i try to get an image displayed that is retrieved from an url. my first
 (false) attempt was not respecting the asynchronous behavior so it only
 worked in hosted mode:
 
 Image image = new Image(someURL);
 view.setImage(image);
 
 but this failed in real mode. so i googled around (besides wrong 
 exampleshttp://examples.roughian.com/index.htm#Listeners~LoadListener and
 this http://code.google.com/p/gwt-image-loader/ ) i found the problem: a
 have to listen to load event. So i changed my code to this:
 
         image = new Image(url);
         image.addLoadHandler(new LoadHandler() {

             @Override
             public void onLoad(LoadEvent event) {
                 view.setImage(image);
                 image.setVisible(true);
             }
         });
 
 the problem is that the event is never been fired or at least onLoad is
 never executed. I also tried to addHandler before setting url. The url it
 self works fine (browser is displaying the image) and log shows positive
 image response:
 
 response : HTTP/1.1 200
 Content-Type: image/png

 graphdata : [B@12505f5
 

 so how to correctly load/display an image in gwt?

 thx 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: Start GWT App from JavaScript

2011-12-18 Thread Derek
I don't think you need to write a linker. Just create a script element
in your js code and add it to the DOM when you need it.

For example,

button onclick=dogwt()Do GWT/button

function dogwt() {
var s = document.createElement(script);
s.src = my.nocache.js
document.body.appendChild(s)
}

This way is the same way jsonp works, so Google jsonp if my code is
broken or you need more options. (Forgive me for not testing that
code, posting from a tablet.)

document.write() clears the entire document before writing, which is
why your screen goes white.

Derek

On Dec 17, 10:33 am, Daniel eklipto...@googlemail.com wrote:
 The nocache.js file from gwt-exporter also can't be loaded dynamically (not
 with document.write() and not with the function from your link above).

 Seems to me writing a linker is the only solution?

-- 
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 for Eclipse on linux

2011-12-06 Thread Derek
I always just download eclipse separately into my own home directory
and run it from its own ~/eclipse directory. Package managers never
seem to set things up the way I want them to.

I've never had any problems using GWT with Eclipse on Linux. I'm doing
it even now. :)

Derek

On Dec 6, 12:28 am, sachin sreenivasan
sachin.sreenivasa...@gmail.com wrote:
 Hi ppl,

    I had GWT working fine on windows. then i decided to try it on
 linux. I gave the command  yum install eclipse-fedorapackager and
 the eclipse got installed on Linux. But when I gave the GWT link in
 the Install Software it failed saying some prerequisites were missing.
 Then I noticed that there were no Java elements at all in eclipse. I
 dint see options like New Java Project and all. Can someone please
 tell me how to install those Java components after installing eclipse?
 Also, is this the main problem that is preventing GWT from getting
 installed? Any other things I need to do after this?

 Regards,
 Sachin

-- 
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: Drag drop

2011-11-12 Thread Derek
You can do it using some of the drag and drop HTML5 javascript stuff.
http://www.html5rocks.com/en/tutorials/dnd/basics/

There aren't any GWT libraries that wrap around the Javascript, but
you can make your own using overlays.

On Nov 11, 11:59 am, Celinio cel...@gmail.com wrote:
 2) Can i easily do drag and drop some file from the file explorer to a
 widget in a web page ?

 I  haven't seen any example that does that.
 Is is possible ?
 The presentation of John La Banca about GWT + HTML5 has a part about the
 drag and drop feature but it's from one widget to another widget.
 I would like to know if it's possible to drag a file from the windows file
 explorer and add it to a widget, for instance a celltable.

 Thanks !

 On Mon, Oct 31, 2011 at 3:31 PM, Konstantin Zolotarev 







 konstantin.zolota...@gmail.com wrote:
  Also GWT has native HTML5 DnD support.

  You could find more info about it here :GWT + HTML5: A web developers
  dream! http://goo.gl/S8pYF

   --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/4UL0ESE9btAJ.

  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.

-- 
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.



Drag and Drop to a RichTextArea / IFrame?

2011-10-26 Thread Derek
I'm trying out some of the fun drag-and-drop stuff in GWT. My current
attempt is to drag a file into a richtextarea, but nothing seems to be
working correctly. It works fine if I use a FlowPanel or some other
GWT widget, but not a RichTextArea despite it have an addDropHandler
method.

Anyone have any experience with this?

My code in onModuleLoad:

DropHandler drop = new DropHandler() {

@Override
public void onDrop(DropEvent event) {
event.preventDefault();

String data = event.getData(text);
GWT.log(text is +data+ and there are
+numFiles(event.getDataTransfer())+ files);
}
};
RichTextArea rt = new RichTextArea();
rt.addDropHandler(drop); // never called even after drag-and-dropping
a file on the rt
RootPanel.get().add(rt);

-- 
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: Radiobutton vs checkbox in celltable

2011-09-16 Thread Derek
The simplest thing to do is to copy and paste CheckboxCell as
RadioCell (for example) and then just change the templates at the top
to input type=radio name=blah  But you do need to put in a
name for a radio cell, and if you use blah as the name than the radio
cell will give you problem if you have cells in multiple columns.

Derek

On Sep 15, 3:02 pm, Roger Studner rstud...@gmail.com wrote:
 If I do a single selection model etc.. (canonical).. I get a checkbox.

 Technically, you'd think, this would render as a radio button..

 Anyone experiment/discover how to replace the default check box column w/ a 
 radio button ?

 thanks

 Roger

-- 
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: Strange Request: How do I open a new browser window, run part of the GWT application there, and communicate with it

2011-09-15 Thread Derek
I once had to do something vaguely similar. I needed to open a GWT app
in a window from a non-GWT app. I called var win =
window.open(GwtHtmlPage.html) and then set the data the GWT app
needed with win.blah = 3 or whatever. Then my GWT app used some JSNI
to fetch that value.

The problem as Robert metioned is that GWT doesn't really want you
doing inter-window communication. So you have to sling your own JSNI.

Derek

On Sep 14, 12:34 pm, Néstor Boscán nesto...@gmail.com wrote:
 Hi

 I have a strange request. I have an application that needs to run on an
 iframe as part of another application. This application needs to open  popup
 browser windows to show additional information, for example a celltable with
 a list. How do I use GWT to run on the new popup browser window and send it
 data?

 Regards,

 Néstor Boscán

-- 
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: File download by GWT client

2011-09-15 Thread Derek
Yes, FileSystem and FileWriter are HTML5 Javascript APIs that are
available to browsers that support them.

And yes, with JSNI. Overlays are described here:
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsOverlay.html

For example, the FileSystem object described at
http://dev.w3.org/2009/dap/file-system/pub/FileSystem/#the-filesystem-interface
would have an overlay like:

public final class FileSystem extends JavaScriptObject {
protected FileSystem() {
}
public native String getName()/*-{
return this.name;
}-*/;
public native DirectoryEntry getRoot()/*-{
return this.root;
}-*/;
}


On Sep 14, 1:59 pm, Marcin Olejarczyk
marcin.xx.olejarc...@softhouse.se wrote:
 Thank for you answer. I am quite a new in Web technologies.

 When you mention about FileSystem, FileWriter for HTML5 do you mean
 JavaScript API available to use in web browser?
 How have you created your own overlay types for the FileSystem /
 FileWriter objects - Did you use JSNI for that?

 On 14 Wrz, 16:59, Derek derekad...@gmail.com wrote:







  Modern HTML5 should allow something along those lines, but browser
  support is going to be pretty hit or miss. I haven't tried exactly
  what you describe, but you should check out FileSystem, FileWriter,
  and blob support (http://www.html5rocks.com/en/tutorials/file/
  filesystem/). In Chrome at least, you can create a file in a temporary
  space, write text to it, and expose that as a filesystem: URL for the
  user to click to download.

  None of that is reflected in GWT currently. I created overlay types
  for the few FileSystem / FileWriter objects I needed on the project
  I'm working on, and you could do similarly. Or you could just sling
  some JSNI.

  Hope that helps,
  Derek

  On Sep 14, 8:28 am, Marcin Olejarczyk

  marcin.xx.olejarc...@softhouse.se wrote:
   Hi,

   Is there any possibility to generate *.txt file and give the user the
   opportunity to download this file locally by typical download web
   browser window only by executing GWT client code without any
   involvement on the server side.

   Shortly: Click the button, generate file on open download window only
   by the client side.

   Thx for any help

   /Marcin

-- 
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: File download by GWT client

2011-09-14 Thread Derek
Modern HTML5 should allow something along those lines, but browser
support is going to be pretty hit or miss. I haven't tried exactly
what you describe, but you should check out FileSystem, FileWriter,
and blob support (http://www.html5rocks.com/en/tutorials/file/
filesystem/). In Chrome at least, you can create a file in a temporary
space, write text to it, and expose that as a filesystem: URL for the
user to click to download.

None of that is reflected in GWT currently. I created overlay types
for the few FileSystem / FileWriter objects I needed on the project
I'm working on, and you could do similarly. Or you could just sling
some JSNI.

Hope that helps,
Derek

On Sep 14, 8:28 am, Marcin Olejarczyk
marcin.xx.olejarc...@softhouse.se wrote:
 Hi,

 Is there any possibility to generate *.txt file and give the user the
 opportunity to download this file locally by typical download web
 browser window only by executing GWT client code without any
 involvement on the server side.

 Shortly: Click the button, generate file on open download window only
 by the client side.

 Thx for any help

 /Marcin

-- 
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: Detect *only* when browser is closing (WindowCloseListener)

2011-08-13 Thread Derek
I'm curious why you have such a specific requirement. When would you
only want a window closing event to fire on browser close?

Anyway, I don't think you can do that. Each window or tab shouldn't
know about any window or tab it didn't create. It might be possible to
detect browser close through an extension/add-on, but I haven't ever
looked into it.

Actually, it might be possible to do that on modern browsers using
sessionStorage. You may be able to add an event to be notified when
the session is being destroyed (which *should* be on browser
close...), but I haven't ever tried that.

Would your requirements allow you to do something on user return? If
so, you could (again) use session storage or a cookie to let you know
if you've seen the user before. If you haven't this time, then you can
do whatever cleanup necessary (or whatever you're trying to do).

Derek

On Aug 12, 7:59 pm, Jose María Zaragoza demablo...@gmail.com wrote:
 Hi:

 I would like to detect *only* when browser is closing

 About WindowCloseListener documentation, events are fired after the
 browser window closes or navigates to a different site.
 And I dont want to do anything when go to another site

 How I can to know this ?

 Thanks and regards

-- 
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: Extending/embedding DialogBox

2011-08-02 Thread Derek
I generally create custom Dialogs as their own uibinders and then
instantiate them from elsewhere. So I might use the code below, and
display it with new MyDialog().center();

Is this best practice? I'm not sure. I think there are some who hold
to the idea that you should let your dialog's content be its own
UiBinder, but that is not precluded by the strategy below. It's the
way we do things at my organization.

ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder
xmlns:g=urn:import:com.google.gwt.user.client.ui
  g:DialogBox modal=true
g:captionDialog!/g:caption
g:HTMLPanel
  g:Button ui:field=closeClose/g:Button
/g:HTMLPanel
  /g:DialogBox
/ui:UiBinder

public class MyDialog {
  private static MyDialogUiBinder uiBinder =
GWT.create(MyDialogUiBinder.class);
  interface MyDialogUiBinder extends UiBinderWidget, MyDialog {}
  DialogBox box;
  public MyDialog() {
box = (DialogBox) uiBinder.createAndBindUi(this);
  }
  public void center() { box.center(); }
  @UiHandler(close) void onClose(ClickEvent event) { box.hide(); }
}

On Aug 1, 10:55 am, Wulfsberg wulfsb...@gmail.com wrote:
 I am a little confused over the best practice use of DialogBox when
 using UIBinders.

 In UIBinder xml, you can include a DialogBox element, and configure it
 using, say, the caption element or text attributes. This seems to hint
 that you can embed a full DialogBox definition, letting a widget carry
 its own DialogBox to pop on demand.
 However, doing so results in the dialog box being shown as part of the
 page on load, and some comments seem to indicate that you're not
 supposed to do this.

 If, on the other hand, you extend DialogBox as its own stand-alone
 widget, you only get to define the *contents* of the dialog box in the
 ui.xml, forcing you to set things like caption and glass pane in the
 Java code, which seems to defy the purpose of a uibinder in the first
 place.

 What am I missing?

-- 
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: CellTree: Horizontal Scrollbar impossible?

2011-07-15 Thread Derek
The get showcase has horizontal scrolling.
http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellSampler

On Jul 15, 9:02 am, opn open...@gmx.net wrote:
 I hope it's not impossible right now to get a horizontal scrollbar
 with a cellTree growing large in x-direction, but I just can not find
 a solution.
 The problem is that the cellTree automatically crates something like:
 div style=overflow: hidden;
 ...
 /div

 I can not find a way to disable this.

 When i disable all these manually with, for example, firebug, my tree
 begins to be scrollable.

 Now the question:

 Did anyone implement successfully a horizontal scrollable CellTree .

-- 
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: Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-06-18 Thread Derek
The only time I encounter what you describe is when I mock the server
side code on the client side. In other words, in your code example, I
might have myRemoteService actually be an instance of some
MyRemoteServiceAsyncMock, that returns dummy data while I wait for
someone else to write the server side impl (or until I do it myself).
In that case the async call is actually sync and so I might need a
deferred command to make sure that code outside the async call is run
before the call itself. Otherwise you should be able to count on
things happening in the expected order.

On Jun 17, 12:29 pm, Tad tadwo...@gmail.com wrote:
 Is the AsyncCallback framework implemented in such a way that when a
 RemoteService method is called, is it a GUARANTEE that the browser's
 event loop will execute at least one cycle before its callback (i.e.
 onSuccess or onFailure) gets called?

 For example:

 ...some code...
 myRemoteService.myMethod( myParameter, new AsyncCallbackString()
 {
    public void onSuccess(String result)
    {
       
    }});

 ...some long running code...

 In the above example, if the result of myMethod happens to return
 before the some long running code finishes, will the browser's event
 loop always receive at least one cycle before onSuccess() is called?
 Or is it ever possible that onSuccess() could get called without
 yielding to the browser's event loop?

 Another way to ask this question would be: Is there ever a scenario
 where it is necessary to do the following (or put the scheduleDeferred
 call inside myMethod's onSuccess callback)?

 Schedule.get().scheduleDeferred( new ScheduledCommand()
 {
    myRemoteService.myMethod( myParameter, new AsyncCallbackString()
    {
       public void onSuccess(String result)
       {
          
       }
    });

 });

 -Tad

-- 
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 pass hash map to native java script method

2011-06-10 Thread Derek
Actually I don't think it's as simple as you'd think. Gwt java objects
are pretty opaque to JSNI. Depending on what you need, i'd suggest
using JSONObject as a replacement for HashMap. That should probably
work for you.

On Jun 8, 9:19 pm, rsutton rsut...@asteriskit.com.au wrote:
 I am trying to pass a Hashmap to a native method as can be seen below.
 I have been unable to find any suitable example code. Any assistance
 would be greatly appreciated.

 I know this is simple, I just haven't done it before.

 Thanks.

 public void onClick(ClickEvent event)
 {
         MapString, String params = new HashMapString, String();
         params.putAll(definition.getParams());

        this is where my problem is, how to convert the params
 object to a suitable
            object to work with the native openReportWindow method

         openReportWindow(definition.getReportServletName(), params);

 }

 private static native void openReportWindow(String action,  values) /*-
 {
            var form = document.createElement(form);
            form.setAttribute(method, post);
            form.setAttribute(action, action);
                                                                               
                                                                               
                // setting form target to a window named
 'formresult'
            form.setAttribute(target, _blank);
                                                                               
                                                                               
                for (var i=0; ivalues.length; i++) {
                 var hiddenField = document.createElement(input);
                 hiddenField.setAttribute(name, values[i].name);
                 hiddenField.setAttribute(value, values[i].value);
                 form.appendChild(hiddenField);
            }
            document.body.appendChild(form);
            form.submit();
            document.body.removeChild(form);
            }-*/;

-- 
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: Hierachy of autobean for state serialization

2011-06-03 Thread Derek
Thanks for posting this, Panam. I was just starting to consider using
AutoBean with LocalStorage, since storing a JSON string seems like the
best solution than rolling my own custom serializer. I haven't gotten
too far into it beyond some simple test cases.

For 2), I seem to recall seeing that polymorphism for AutoBean is an
eventual goal for the GWT group, but 2.3 doesn't support it.

For 1), my thoughts would either be on using AutoBeanVisitor (which
can only see things already explicitly added, so probably not) or a
generator (which might trip up AutoBean's generator), but I haven't
tried either in the way you describe, so maybe I'm wrong.

I think the official way is to have an interface for each subclass in
your AutoBeanFactory, so for example:

public interface Base {
  getName() / setName()
}

public class BaseImpl implements Base { ... }

public interface Color extends Base {
  getColor() / setColor()
}

public class ColorImpl extends BaseImpl implements Color { ... }

public interface Serializer extends AutoBeanFactory {
  AutoBeanBase wrap(Base wrap);
  AutoBeanColor wrap(Color wrap);
}

That works if you only have a small handful of subclasses, but it gets
progressively worse the more you add.

On Jun 2, 3:48 am, Panam pandem...@googlemail.com wrote:
 Hm, I am just looking for a way to enocde and persist (webstore) state
 (some POJO properties) on the client.
 I have difficulties to see see how the RequestFactory will help me
 here as my intention is that it is for client server communication.
 However, it ought to be possible (at least, it has to do serialization
 to put the data on the wire).
 As I understand autobeans, they are that part of the bindery framework
 that is used for this purpose (amongst all by the request factory
 itself). That's why I am trying to use them here.

 Regards,
 panam

-- 
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: Mixing Autobean with JSONP

2011-05-29 Thread Derek
T needs to extend JavaScriptObject. It is part of GWT's overlay types,
which is a little bit different from AutoBean. See
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsOverlay.html
for more information.

On May 29, 1:36 am, karthik reddy karthik.ele...@gmail.com wrote:
 Can AutoBean used to bind the response of a JSONP request ?? I tried but
 with no success.

 For example:

  JsonpRequestBuilder jsonp = new JsonpRequestBuilder();

  jsonp.requestObject(url,
      new AsyncCallbackT() {
        public void onFailure(Throwable throwable) {

        }

        public void onSuccess(T mybean) {
          // Success!
          }
        }
      );

 Can T be a AutoBean or some variant of a autobean.

 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: User GWT to develop android apps that are not browser based?

2011-05-20 Thread Derek
Not sure what you want here. Android development is a separate thing
from Web development, and GWT is for the web. However since they're
both Java-based there are opportunities to re-use code in either, if
you want to write both an android and web version of your app.

Granted, Android has WebViews which embeds the webkit rendering engine
in your app, and you can easily use GWT for that aspect of development
(I've done that). The result would certainly be something you could
put on Android Market, though hopefully you're adding some Android
integration and not just repackaging a webpage.

Since you've already been watching Google I/O talks, let me recommend
a couple more:

http://www.google.com/events/io/2011/sessions/html5-versus-android-apps-or-web-for-mobile-development.html
- HTML5 vs Android Apps goes into a lot of the reasons you might want
to create an Android App rather than a mobile web app, and vice versa.
To boil down a lot of it, mobile web apps are cross platform (work on
iOS, webOS, etc), while android apps allow tighter integration with
the device.

http://www.google.com/events/io/2011/sessions/android-app-engine-a-developer-s-dream-combination.html
- This is a really cool talk that I wish I had attended. It shows how,
using GPE, you can create an app that does reuse a lot of code between
GWT and Android with an AppEngine backend.

Hope that helps,

Derek

On May 19, 3:55 pm, cri chuck.irvine...@gmail.com wrote:
 I just skimmed through the Google IO talk by Chris Ramsdale on using
 GWT to build mobile web apps, hosted on Android for example.
 Interesting, but what about using GWT to develop an Android app that
 isn't accessed via the browser, i.e. that is downloaded through the
 Android Market? Is this possible? The latter seems more like a first
 class android application. 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: GWT Google/io meeting on Monday night

2011-05-06 Thread Derek
I'll be in SF for Google I/O. I'm arriving with a friend (who also
does GWT work), but I'm not sure what our plans are for Monday night.
We might be interested in a get together.

On May 5, 1:56 pm, Jeff Larsen larse...@gmail.com wrote:
 Hey was wondering if there is any interest in a gwt get together on Monday
 night in SF.

 I'm flying in and will be in the city ~7pm. If there is enough interest,
 maybe we could get a get together someplace, preferably with
 beer/cocktails.

 If anyone has any good ideas for a location to do this close to Mosconi,
 that will probably be better than me doing a google search for restaraunts
 in the area.

 Reply here if you're going to be in SF and interested in meeting up Monday
 night.

-- 
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.



Setting extra information on provided Cells?

2011-04-11 Thread Derek
Far too often, I seem to have to create new Cells that do very similar
functionality to built-in Cells. For example, I've had to create a
SelectionCell that can alternately show a listbox as either enabled or
disabled, or create a SelectionCell that has different options in the
listbox depending on the row type. I've had to create an ImageCell
that shows alt text, an EditTextCell that uses a textarea instead of
an text box, and a CheckboxCell that displays a radio button instead
of a checkbox.

In each of these cases, I have to go find the GWT source code for the
cell, copy and paste it into a new class in my project, and start
making the tweaks necessary to do the desired result. Already this has
required tweaks to my code since CheckboxCell has changed since 2.1.0
and so RadioCell has needed corresponding changes. This seems to break
the OO design philosophy, but there aren't easy extension points in
the above cells that make subclassing easy.

Is there a better way to create these Cells without the ugly?

Thanks,
Derek

-- 
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 Google IO 2011 Challenge Winners?

2011-04-05 Thread Derek
I won! But not the GWT challenge, the commerce challenge. But I used
GWT for commerce so that counts for something, right?

And since I'm tooting my own horn, here are my submissions: (only can
guarantee they look right in linux chrome (even win chrome displays
the doodle and countdown differently from how I saw them on linux))

Doodle (Chrome challenge) : http://ddean.johnsoncs.com/doodle.html
(wait until the end for css3 effect)

Commerce challenge : http://2.ddean-lastcall-ae.appspot.com/

Countdown (GWT challenge) : 
http://3.ddean-lastcall-ae.appspot.com/countdown.html
(use mouse wheel and shift-mouse wheel, or type something matching /
[NnPp]/, or click the buttons at the top)

I won't show my Games or A11y submissions as they are even more awful
than the above.

Every single one of my submissions used GWT, including the a11y
challenge, which was to write an android app (and me without an
android phone...).

On Apr 5, 6:41 am, Erik Uzureau euz...@gmail.com wrote:
 Did Google Announce winners yesterday?

 Curious to see the winning submissions...

 Erik

-- 
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 restore previous value of EditTextCell in Cell Table

2011-04-05 Thread Derek
I only know a bad way to do this, so I'd like someone else to show me
a better way to do this.

As with most GWT Cells, as soon as I want to do something different, I
have to create my own. So I suggest you look up the code for
EditTextCell, copy and paste it into a new MyEditTextCell and then
change the commit() method to do what you want.

In my case, I needed EditTextCell to use a textarea instead of a
textbox, so I had already copied and pasted the code out to make it
use a textarea. When the requirement came down that I needed to give
people a confirm when they changed the text (sigh), I modified the
commit method similar to:

private void commit(final Context context, final Element parent,
final ViewData viewData, final ValueUpdaterString valueUpdater) {
if(Window.confirm(Really update value?)) {
String value = updateViewData(parent, viewData, false);
clearInput(getInputElement(parent));
setValue(context, parent, viewData.getOriginal());
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
}

I'd be happy if someone could point out a way to do things like this
in a way that allows me to not have to copy/paste GWT Cell code into
my own project.

On Apr 4, 5:04 pm, Ankur ankurn...@gmail.com wrote:
 Hello,

 I am using CellTable to retrive data from server. I have a
 EditTextCell. When I try to validate EditTextCell I cannot restore to
 my previous data. I tried to use cellTable.redraw(). Also I tried
 using EditTextCell et.SetViewData(Key,ViewData). I am not able to set
 view data for this function. Can some one help me out.

 here is my code:
 Here I get error that View Data is not visible.
 columnDN.setFieldUpdater(new FieldUpdaterFieldPoolMsg, String() {

                         @Override
                         public void update(int index, FieldPoolMsg object, 
 String value) {
                                 if (value.isEmpty()) {
                                         Window.alert(Display Name cannot be 
 blank.);

                                         
 displayNameCell.setViewData(KEY_PROVIDER.getKey(object),
                                                         
 displayNameCell.getViewData(KEY_PROVIDER.getKey(object)));
                                         cellTable.redraw();
                                         return;
                                 }
                                 object.setFieldDisplayName(value);
                                 object.setPendingUpdate(true);
                                 cellTable.redraw();
                         }
                 });

-- 
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: Events: One handler many sources

2011-03-08 Thread Derek
Hi Mike,

My first thought is that maybe using events isn't really what you
want. Without knowing specifics, is this something that would fit
better as a singleton?

Foo.get().doFoo();

(or if you use GIN bind(Foo.class).in(Singleton.class); and then you
can @Inject Foo)

However, if the event model is what you want to use, you can pass
around a common EventBus with which you can fire() events.

in module load or wherever appropriate:

myEventBus.addHandler(FooEvent.TYPE, new FooHandler());

and in your sources

myEventBus.fire(new FooEvent());

Hope that helps,

Derek

On Mar 5, 3:38 pm, manstis michael.ans...@gmail.com wrote:
 Hi,

 Perhaps I horribly misunderstand GWT'seventmechanism, but I am
 struggling with wiring up the following scenario with the 
 usualHandler,Eventtypes...

 * I have oneHandlerof a specificeventtype
 * I have multiple sources of the sameeventtype

 I didn't want to add HasXXXHandler to every source just so I can 
 callEvent.fire(this) to trigger theevent.

 The mechanisms in place seam to prefer one source to many handlers...

 Pointers, thoughts, criticism etc welcome :)

 Thanks,

 Mike

-- 
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: SelectionCell

2011-03-01 Thread Derek
I had to roll my own SelectionCell when I needed to do that. The
version I wrote ended up using app specific classes so it's not really
fit for mass consumption.

In general though, start with the SelectionCell code, remove
indexForOption and options, and add a MapK, ListE options in its
place (making K whatever type you need it to be (enum in my case)).
Then fix all the build errors in the rest of the code. :)

In the render and onBrowserEvent methods, you'll probably need to call
context.getKey() to get the row key. If you *don't* use a keyprovider
on your celltable, then the key will be the row object (which is what
I do). Cast the object to what you know it will be and then call the
methods on that object you need to get the key for your options map.
Now you have your list of options per row object.

Not the prettiest code, but it got the job done.

Derek

On Feb 28, 8:47 am, Ani anapont...@gmail.com wrote:
 Hello,

 Can the SelectionCell have different data on different rows?Could
 anybody give some example on that, please???
 Thank you very much 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: GPE auto-complete only partially working for UiBinder tags

2011-02-26 Thread Derek
Sekhar,

Can you explain that more clearly? I don't see any Make this the
default editor option. Eclipse will remember which editor I want to
use for a particular file, but I don't see a way to make that change
globally.

For example, if I open Widget1.ui.xml, it opens in WindowBuilder. I
can right-click and choose Open With - UiBinder Template Editor (or
Other - UiBinder Template Editor, they work the same for me) and then
whenever I reopen Widget1.ui.xml, it reopens in UiBinder Template
Editor. However, when I then open Widget2.ui.xml, it opens in
WindowBuilder, and I have to repeat the process for that and every
other *.ui.xml file I have. I would like to make the change once, and
then any time I open a *.ui.xml, it automatically opens in the
UiBinder Template Editor.

Thanks,
Derek

On Feb 25, 10:07 am, Sekhar Ravinutala sek...@allurefx.com wrote:
 If you want to make UiBinder Template Editor the default, choose it through
 Open With-Other rather than directly.

-- 
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: GPE auto-complete only partially working for UiBinder tags

2011-02-21 Thread Derek
I can't make it default and filed a bug.
http://code.google.com/p/google-web-toolkit/issues/detail?id=6039

You should be able to go to Window  Preferences  General  Editors 
File Associations and in the list on the right, choose *.ui.xml and
choose between UiBinder Template Editor and WindowBuilder Editor, but
it's not there. I tried clicking Add... and adding *.ui.xml as a new
type, but it throws an assertion error in the Eclipse log.

On Feb 20, 4:21 pm, Filipe Sousa nat...@gmail.com wrote:
 Thanks for the tip Thomas.
 By the way, do you know if there is any way to make it default?

-- 
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: development mode rpc call is an http OPTIONS instead of POST

2010-01-05 Thread Derek
I'm having a very similar problem, but don't have an answer yet.

I'm using the RequestBuilder to do an HTTP POST to our IIS server.
Everything seems fine when I'm in the Java debugger in hosted mode,
but when I compile to Javascript, my POST is changed to OPTIONS in FF
and Chrome, but it works properly in IE.

I've been stuck on this problem for days now.

On Jan 4, 4:51 pm, lfrohman lfroh...@gmail.com wrote:
 After upgrading my application to GWT 2.0, I am getting a
 com.google.gwt.user.client.rpc.StatusCodeException on an rpc call in
 Development mode.
 This only happens in Development mode, and only in Chrome and FF, it
 works fine in IE.
 When I look at the apache logs for production mode (and development
 mode in IE), the rpc
 call becomes an http POST:

 127.0.0.1 - - [04/Jan/2010:16:25:56 -0800] POST /parvia/piece.rpc
 HTTP/1.1 200 1943 http://localhost:/commerce/hosted.html?
 commerce Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
 Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; OfficeLiveConnector.
 1.4; OfficeLivePatch.1.3)

 but in Firefox and Chrome Development mode, the rpc call results in an
 http OPTIONS:

 127.0.0.1 - - [04/Jan/2010:16:28:24 -0800] OPTIONS /parvia/piece.rpc
 HTTP/1.1 200 - http://localhost:/commerce/hosted.html?commerce;
 Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5
 (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5

 anyone have an idea what is causing this?

 Thanks,
 Lance

--

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: development mode rpc call is an http OPTIONS instead of POST

2010-01-05 Thread Derek
I found out what was causing my problem.

My RequestBuilder was originally constructed as: new RequestBuilder
(RequestBuilder.POST, http://localhost/appdir/somefile.aspx;);

Once I used either a specific machine name or relative path then it no
longer switched the from POST to OPTIONS. I now have the following:
new RequestBuilder(RequestBuilder.POST, /appdir/somefile.aspx);

On Jan 5, 7:49 am, Derek dealy...@hotmail.com wrote:
 I'm having a very similar problem, but don't have an answer yet.

 I'm using the RequestBuilder to do an HTTP POST to our IIS server.
 Everything seems fine when I'm in the Java debugger in hosted mode,
 but when I compile to Javascript, my POST is changed to OPTIONS in FF
 and Chrome, but it works properly in IE.

 I've been stuck on this problem for days now.

 On Jan 4, 4:51 pm, lfrohman lfroh...@gmail.com wrote:

  After upgrading my application to GWT 2.0, I am getting a
  com.google.gwt.user.client.rpc.StatusCodeException on an rpc call in
  Development mode.
  This only happens in Development mode, and only in Chrome and FF, it
  works fine in IE.
  When I look at the apache logs for production mode (and development
  mode in IE), the rpc
  call becomes an http POST:

  127.0.0.1 - - [04/Jan/2010:16:25:56 -0800] POST /parvia/piece.rpc
  HTTP/1.1 200 1943 http://localhost:/commerce/hosted.html?
  commerce Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
  Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
  3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; OfficeLiveConnector.
  1.4; OfficeLivePatch.1.3)

  but in Firefox and Chrome Development mode, the rpc call results in an
  http OPTIONS:

  127.0.0.1 - - [04/Jan/2010:16:28:24 -0800] OPTIONS /parvia/piece.rpc
  HTTP/1.1 200 - http://localhost:/commerce/hosted.html?commerce;
  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5
  (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5

  anyone have an idea what is causing this?

  Thanks,
  Lance
-- 
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.




RequestBuilder.sendRequest() failing in firefox but not IE

2009-12-18 Thread Derek
Hi

I recently upgraded to GWT 2.0 along with GXT 2.1. My application was
working properly back at GWT 1.7, and now it mostly works fine with
2.0. But there is a problem with web requests and responses I can't
figure out.

When run in hosted mode and debugging in Java with Eclipse everything
is fine. My GWT app communicates with the server from Firefox with no
problems. However once I compile the app into javascript and run it
from within Firefox or Chrome, none of my requests appear to be making
it to the server (which is IIS). However if I use IE 7 the javascript
compiled code works just fine.

When I'm debugging with Firebug I don't see any of my httprequests
going out to the server, and all responses come back with an empty
string from Response.getText().

My code which sends the HTTP POST looks like this:
RequestBuilder builder = new RequestBuilder(
RequestBuilder.POST, INVOKE_URL);
builder.setHeader(Content-Type, 
application/x-www-form-
urlencoded; charset=UTF-8);

WebResponseRequest invoke = new 
WebResponseRequest(callback);
request = builder.sendRequest(
buildRequestData(method, parameters),
invoke);

public void callback(Request req, Response resp) {
String str = resp.getText();
if (str.isEmpty())
throw new Exception(no response data);
...
}

Any ideas of what maybe wrong here?

--

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.




1.7-2.0 hosted mode no longer working

2009-12-15 Thread Derek
Hi

I had my GWT app running in hosted mode last week with GWT 1.7,
Eclipse 3.5, GXT with the server side hosted by IIS.

So I upgraded to GWT 2.0, upgraded the plugin in Eclipse, downloaded
the GWT 2.0 SDK and am trying to get my application running once
again. So far no luck though.

My old run configurations are still in Eclipse, it was originally
setup so that I was not running the built in server (since we have IIS
on the backend) and we had this for program arguments: -whitelist
http://localhost/war/KryptoniteDesktop.html;.

If I launch my old run configuration I get the new Development Mode
window which shows the following URL to view in development mode:
http://localhost:/KryptoniteDesktop.html?gwt.codesvr=172.17.3.67:9997

However this doesn't work, when I point my browser to the suggested
URL I get the following:
Firefox can't establish a connection to the server at localhost:.

I don't know why its referencing localhost: given I don't have the
checkbox for the built in server checked. I can't find anything that
discusses using the new Development mode when not using the built in
server.

Do I need to use the bult in server when in Development Mode of GWT
2.0?

Any idea how to configure this so I can debug my application again?

Thanks, Derek

--

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.




TextBox.setFocus() not working as expected in Firefox

2008-08-25 Thread Derek Battams

package sample.test.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.FocusListenerAdapter;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * Entry point classes define codeonModuleLoad()/code.
 */
public class TestClient implements EntryPoint {

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
  VerticalPanel vPanel = new VerticalPanel();
  TextBox tBox1 = new TextBox();
  TextBox tBox2 = new TextBox();
  tBox2.addFocusListener(new FocusListenerAdapter() {
  @Override
  public void onLostFocus(Widget sender) {
  TextBox tBox = (TextBox)sender;
  if(!tBox.getText().equals(good))
  tBox.setFocus(true);
  }
  });
  vPanel.add(tBox1);
  vPanel.add(tBox2);
  RootPanel.get().add(vPanel);
  return;
  }
}

In hosted mode (WinXP GWT 1.5.1) and in IE (IE6 and IE7) this code
works as expected - if the user types in something other than good
in the second box and attempts to leave the box then focus is
immediately returned to tBox2.  However, in Firefox (FF2 and FF3)
focus is not returned to tBox2 when it should be.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---