Re: gwt 2.x maven linux support

2010-07-28 Thread Olivier Monaco
Hi,

You need to use version 1.2 of gwt-maven plugin. The 1.1 does not
support GWT 2.0 due to the replacement of Hosted Mode by the Dev Mode.
The Hosted Mode is specific for each platform and so gwt-maven
plugin need to download a jar specific to linux. But with the Dev
Mode, the same code (the same jar) is used for all platform.

Olivier


On 28 juil, 13:55, Ovidiu Drumia ovidiu.dru...@gmail.com wrote:
 Hey,

 I've started using gwt. I'm currently trying to integrate my new
 project within a maven module suite, using the codehaus gwt-maven
 plugin. My pom.xml file contains gwt dependencies. All is well until I
 try to go beyond the 1.x gwt version. The pom.xml contains the
 following code:
 ...
     properties
                gwt-versionx.x.x/gwt-version
      /properties
 ...
        dependencies
 ...
                dependency
                         groupIdcom.google.gwt/groupId
                         artifactIdgwt-servlet/artifactId
                         version${gwt-version}/version
                         scopecompile/scope
                 /dependency
                 dependency
                         groupIdcom.google.gwt/groupId
                         artifactIdgwt-user/artifactId
                         version${gwt-version}/version
                         scopeprovided/scope
                 /dependency
         /dependencies
         build
                 plugins
                         plugin
                                 groupIdorg.codehaus.mojo/groupId
                                 artifactIdgwt-maven-plugin/artifactId
                                 version1.1/version
                                 executions
                                         execution
                                                 goals
                                                         goalclean/goal
                                                         goalcompile/goal
                                                         goaleclipse/goal
                                                 /goals
                                         /execution
                                 /executions
                         /plugin
                 /plugins
         /build

 Now until after version 1.7.1 the project compiles. When I try to go
 beyond it, it first tells me to manually download the gwt-
 dev-2.0.4.jar and then install it. I've done that, but afterwards it
 tells me to do the same thing with gwt-dev-2.0.4-linux-lib.zip, but
 the maven2 repo does not contain such a file.
 Will the gwt team publish the remaining needed libraries onto the mvn
 repo?
 Is there any way to use the gwt-maven-plugin and gwt 2.0.4?
 Should I stick to gwt 1.7.1 until the gwt team provides the needed
 linux libraries?

-- 
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: VerticalPanel inside ScrollPanel inside StackPanel - no scrollbars?

2010-07-21 Thread Olivier Monaco
Hi

You may be interested in reading 
http://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideUiPanels.html

Olivier

On 21 juil, 13:35, Magnus alpineblas...@googlemail.com wrote:
 Hi,

 I've got it working now. The actual hierarchie is: DockLayoutPanel -
 StackLayoutPanel - ScrollPanel - VerticalPanel.

 However, what is this all about with these multiple classes for one
 and the same thing:
 DockPanel - DockLayoutPanel
 StackPanel - StackLayoutPanel
 ...

 What's the difference, e. g. between StackPanel and StackLayoutPanel,
 and when should I use which?

 Thanks
 Magnus

 On Jul 21, 12:13 pm, Prashant Hegde prashant.he...@gmail.com wrote:

  Not sure abt the ScrollPanel but, I have also found out ( the hard way)
  VerticalPanel ( table based ) does not work well with layout panels (div
  based) .. Try using a DockLayoutPanel - with all widgets added to the
  north - instead... may be worth a try.

  - Prashant

  On 21-07-2010 10:58, Magnus wrote:

   Hi Prashant,

   I have done everything you said, with some losings, but also without
   success (scrollbars):

   - I changed the StackPanel into a StackLayoutPanel

   - then, the CSS padding (10px) has no effect anymore
      (the stack is aligned directly at the left edge, without space, but
   ok)

   - I added overflow:auto to the inner CSS container, which is a
   VerticalPanel

   - but there is no scrollbar...

   Why doesn't ScrollPanel work here?

   Magnus

   On Jul 21, 5:32 am, Prashant Hegdeprashant.he...@gmail.com  wrote:

   The way I would go about doing this is as follows, see if this works for
   you or gives any hints:

   0. Make sure you are in STANDARDS mode.
   1. Use StackLayoutPanel and add it to your parent LayoutPanel ( mixing
   StackPanel with a DockLayoutPanel gives unpredictable results - so some
   one has said  I have found out the hard way )
   2. Set the width and height to 100%
   3. For the container widget ( FlowPanel / HTMLPanel ) you add to the
   StackLayoutPanel, put a CSS overflow: auto. This indicates that if
   whatever the container contains grows beyond the container then a scroll
   bar is shown. If you have a container within a container, and overflow
   setting should be on the right container - just above the element whose
   overflow you want to control. Firebug usually helps me figure out this.

   Review the container hierarchy using Firebug to make sure that there are
   no intermediate containers which makes your setting ineffective.

   Hope this helps.

   On 21-07-2010 05:34, Magnus wrote:

   Hi,

   I want to show the contents of a log file inside a StackPanel. The log
   file itself is a class LogPanel based on a VerticalPanel. Because
   the log file grows, I added an intermediate ScrollPanel (see code
   below).

   The problem: The ScrollPanel never shows scrollbars. Instead, it grows
   as the LogPanel grows, beyond the size of the containing StackPanel.

   I would like the ScrollPanel to occupy all available space within the
   StackPanel and to show scrollbars, when the inner LogPanel gets
   bigger.

   The demo of the StackPanel class in the GWT showcase application
   assumes that there is enough room for the contents.

   Can you help?

   Thanks!
   Magnus

   -

   public class MyStackPanel extends StackPanel
   {
      public MyStackPanel ()
      {
       super ();
       setSize(100%,100%); // we are in the west edge of a
   DockLayoutPanel
      }

      public void add (LogPanel log)
      {
       ScrollPanel p = new ScrollPanel ();
       p.add(log);
       add (p,Log);
       p.setSize (100%,100%);
      }
   }



-- 
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: Compiler Bug in 2.1.0.m2

2010-07-20 Thread Olivier Monaco
Hi,

I've updated the issue with a more specific test case and a possible
workaround.

Olivier

On 19 juil, 15:09, Björn bjoernham...@web.de wrote:
 Hi George, hi Gal,

 thanks for you help! The Resymbolization did the trick.

 After having two days of real fun with compiled javascript I think I
 found a bug in the gwt compiler. If your interested take a look 
 athttp://code.google.com/p/google-web-toolkit/issues/detail?id=5133.

 Hope it will be fixed soon...

 cheers,

 Björn

-- 
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: Compiler Bug in 2.1.0.m2

2010-07-20 Thread Olivier Monaco
If you think so, star the issue

On 20 juil, 15:46, Paul Stockley pstockl...@gmail.com wrote:
 The GWT team needs to be all over issues like this. Nothing will put
 people off GWT quicker than a flaky compiler you cannot depend on.

 On Jul 20, 5:53 am, Olivier Monaco olivier.mon...@free.fr wrote:

  Hi,

  I've updated the issue with a more specific test case and a possible
  workaround.

  Olivier

  On 19 juil, 15:09, Björn bjoernham...@web.de wrote:

   Hi George, hi Gal,

   thanks for you help! The Resymbolization did the trick.

   After having two days of real fun with compiled javascript I think I
   found a bug in the gwt compiler. If your interested take a look 
   athttp://code.google.com/p/google-web-toolkit/issues/detail?id=5133.

   Hope it will be fixed soon...

   cheers,

   Björn

-- 
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: Eclipse debugger not running in hosted mode?

2010-07-16 Thread Olivier Monaco
Hi,

When your app run, do you have some trace in the Development Mode
tab in Eclipse? If you had some error in your code (compilation
error), do your app still run? Or changes are used?

Olivier

On 16 juil, 07:37, David Vree david.h.v...@gmail.com wrote:
 I should mention that the only jar I have in my WEB-INF/lib is gwt-
 servlet.jar -- do I need any of the others?

 On Jul 16, 12:36 am, David Vree david.h.v...@gmail.com wrote:

  I did!  In fact it's only in the debug configurations menu...not the
  run configurations menu.

  I am using maven and am wondering if there is an issue there
  Although Eclipse is compiling my classes to war/WEB-INF/classes

  On Jul 15, 10:53 pm, lineman78 linema...@gmail.com wrote:

   You have to make sure you start it with Debug As not Run As

   On Jul 15, 8:20 pm, David Vree david.h.v...@gmail.com wrote:

I believe so, but I don't know how to tell for sure.  I can tell you
that the Development Mode tab in Eclipse gets focus, and provides me
the following URL:

   http://127.0.0.1:/index.html?gwt.codesvr=127.0.0.1:9997

When I put that URL in the browser the app runs.  But no stopping from
within Eclipse!

On Jul 15, 8:38 pm, lineman78 linema...@gmail.com wrote:

 Are you running in the embedded server?

 On Jul 15, 2:05 pm, David Vree david.h.v...@gmail.com wrote:

  I have tried to use the Eclipse debugger with the sample application
  in hosted mode, so I know it works.  But in my own application (a
  multi-module maven project) the stop point I put on OnModuleLoad 
  isn't
  triggering.

  I've tried many different things.  Any ideas?



-- 
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: Possible to access GWT-RPC serializer?

2010-07-16 Thread Olivier Monaco
Hi Sekhar,

You have some framework like piriti (http://code.google.com/p/piriti/)
for JSON serialization of data. It can be a good start. However, it
does not use overlays: it copy JSON values to POJO fields.

Maybe you can be interested in my code: 
http://code.google.com/p/tyco/source/browse/?repo=tikray
The idea is to define interfaces for data. A generator automatically
create implementation for GWT with zero-overhead (no field copy, just
wrappers arround JSON value that will be removed by the GWT
optimizer). This part starts to work with (many) limitations. The
second part is to create some Java proxy to use the same mechanisms on
server. I'm owrking on. Maybe this code can help you.

Olivier

On 15 juil, 18:03, Sekhar sek...@allurefx.com wrote:
 Thanks guys, yes looks like JSON is the way to go. POJO-JSON should
 be easy (using the JSON API), but the other way is a bit tricky. I
 don't think overlays help because the JavaScript side never sees the
 objects (just the string) and the JSON-POJO process shouldn't depend
 on the specific class. As I understand overlays (http://goo.gl/fNzG),
 you need to (1) have the object in JS and (2) know the attributes.

 I'm experimenting with rolling my own, will post back results.

 On Jul 15, 8:08 am, Paul Stockley pstockl...@gmail.com wrote:

  You could use JSON and javascript overlay types to access the
  information in a type safe way.

  On Jul 15, 10:55 am, Stefan Bachert stefanbach...@yahoo.de wrote:

   Hi Sekhar,

   this is my first thought. Just use JSON. Then you can use eval to
   read it.
   However, I do not know any method to export a object to json string.
   But this should not be too complicated to do yourself, or lookout for
   such a library

   Stefan Bacherthttp://gwtworld.de

   On 15 Jul., 01:34, Sekhar sek...@allurefx.com wrote:

Thanks, yeah - sawhttp://goo.gl/fTloafterIposted. So, I guess
we'll need to implement something of our own, like a simple to/from
JSON strings. Any other thoughts/suggestions?

On Jul 14, 3:37 pm, Thomas Broyer t.bro...@gmail.com wrote:

 On 14 juil, 21:41, Sekhar sek...@allurefx.com wrote:

  Guys, I'm trying to use HTML5 Local Storage and am wondering how I 
  can
  save the data from the server as a string. Since GWT-RPC already
  serializes/deserializes Java serializable objects, is there a way to
  access its serialization functions to marshal the data to/from the
  Local Storage strings?

 You can gain access to the GWT-RPC serialization code (provided your
 objects are used in a GWT-RPC somewhere, so the GWT compiler generates
 the appropriate serialization/deserialization code), but it won't be
 of any help in your case, as GWT-RPC serialization is asymmetric (for
 performance reasons).



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



Re: GWT and HTML5 Features.

2010-06-25 Thread Olivier Monaco
Maybe http://code.google.com/p/gwt-mobile-webkit/

Olivier

On Jun 25, 4:38 pm, Ravi Sharma ping2r...@gmail.com wrote:
 Hi All,
 How can we use GWT with HTML5 local database storage feature. I was
 thinking about using Google gears but then HTML5 is coming where each
 browser will be implementing the local database and user dont need to
 install gear plugin.
 Is there any demo/example how can we use HTML5 local database(browser
 database) in GWT

 Thanks,
 Ravi.

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



Re: GWT Application does not work in IE8 at all?

2010-06-23 Thread Olivier Monaco
Hi,

You added a catch block. What is the caught exception? Can you add a
uncaught exception handler using GWT.setUncaughtExceptionHandler in
the constructor of your EntryPoint? Do you catch an exception? Do you
have a small project with this error?

Olivier

On Jun 13, 6:48 pm, Xandel xandelf...@gmail.com wrote:
 Hi there,

 Hopefully you guys can help me. I have built a GWT application which
 runs perfectly in Firefox and Chrome.

 When attempting to load it up in Internet Explorer 8 I get the error
 from one of my generated cache.html files:

 Line: 408
 Char: 12
 Error: Exception thrown and not caught.
 Code: 0

 When I locate that line in the generated file (this was all done with
 the -PRETTY argument for easy reading) I find it's on this line where
 the finally is at:

 function entry0(jsFunction, thisObj, arguments_0){
   var initialEntry;
   initialEntry = entryDepth++ == 0;
   try {
     return jsFunction.apply(thisObj, arguments_0);
   }
   finally {
     initialEntry  $flushFinallyCommands(($clinit_16() , INSTANCE));
     --entryDepth;
   }

 }

 The problem is that this is not code generated from my client side
 java - it seems to be GWT's own generated code.

 As a test I added an empty catch block - that now stops Internet
 Explorer from complaining but still doesn't load my application up at
 all. All that loads is the surrounding html and images and a blank
 space where my app should be.

 Has anyone experienced this before? Any ideas on how to tackle this?

 Any information will be greatly appreciated!

 Thanks in advance,

 Xandel

-- 
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: Hiding fully qualified class name sent to the browser

2010-06-23 Thread Olivier Monaco
Hi,

If your problem comes from class name included in the JavaScript files
(and affected to some properties of JavaScript object), you can try to
use the following optimization:

http://code.google.com/p/google-web-toolkit/wiki/NoClassMetadataOptimization

Olivier

On Jun 22, 3:55 pm, moorsu moo...@gmail.com wrote:
 Hi,

 Would it be possible to obfuscate the fully qualified class name which
 is
 visible at the browser if you use firebug?.

 I would like to see it as a.b.c.d instead
 com.mycompany.myproduct.mypackage.MyClassName.
 Also I do not use the same domain object as model but use Lists and
 Maps to send data to
 browser.

 thanks!

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



Re: Million access to GWT Appl ??

2010-06-22 Thread Olivier Monaco
Yes, but think that user will ask for more interactivity... resulting
in more requests. But, of course, bandwidth, CPU and memory will be
saved. They will be saved more is a good architecture is used like a
Rest-like server, I think.

Olivier

On Jun 22, 10:33 am, Chris Boertien chris.boert...@gmail.com wrote:
 Your essentially asking the wrong question. I think its better to
 think of by how much will GWT or products similar to GWT reduce the
 load on a server.

 You have to consider the fact that every user accessing a traditional
 website backed by a templating engine involves alot of resources for
 each and every request for new information.

 Take a web forum for example. I think they are probably one of the
 least effecient communication mediums and would be very interesting to
 see a GWT implementation of one. With the status quo web forum you
 have full page loads happening every single time a user wants to move
 around on the forum. And if the user wants to see what is new on the
 forum... you guessed it, full page load.

 Now, if you consider all the ways that having most of the web forum on
 the client side and using much more lightweight RPC calls to get new
 info (and ONLY new info) there would be quite large improvements. I
 wouldnt be suprised if the resource requirement of a GWT based web
 forum dropped the load on even the most highly active forums by
 upwards of 80%, and probably more if you really took the care to setup
 some proper caching. But regardless of how the server resource load
 would drop, just the bandwidth drop alone would be a 100% win.

 2010/6/21 Jaroslav Záruba jaroslav.zar...@gmail.com:



  On Mon, Jun 21, 2010 at 9:28 PM, rakesh wagh rake...@gmail.com wrote:

  If you compare gwt to other js based toolkits, they all behave similar
  as far as client to server communication is concerned. gwt only makes
  life simple for the developers.

  ...and (with comparably complex UI) makes your JavaScript run faster :)

  Rakesh Wagh

  On Jun 19, 7:44 pm, manish kumar manish.online2...@gmail.com wrote:
   Hi, i have gone through many articles on web and found that GWT is not
   good for an application that has million users access simultaniouly.
   Is that really true? If not then what should i do make it accessible
   by million users?Is that really tough job in GWT?

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

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

-- 
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: Dynamic Module Loading

2010-06-22 Thread Olivier Monaco
If your need is only to define new view (with few logic), maybe using
a descriptive language will be better. You can write a templating
engine using GWT like a XUL interpreter or something like that. This
is not the best approach for optimized JS (file size, speed...) but
may be the best compromise. I think GWT compilation is too heavy to be
done on server, and worse, on the fly.

Olivier

On Jun 21, 4:52 pm, ruds roud...@gmail.com wrote:
 Hello there,
 I know that this topic has been circling around for a while and i
 thought to bring it up again just for the sake of discussion and in
 case someone else has found an alternative for it.

 One of our requirements is to be able to load a compiled GWT module at
 runtime, bc we have a compiler unit that runs on the server where you
 can define the UI Components of a UI View and customized it per user
 and language.
 Since we are compiling all the Views through our compiler unit(Not GWT
 Compiler) then we dont want to load the screen dynamically. it is much
 like flex/flash, they do the design through a flash designer and then
 they compile the MXML and generate the SWFs. at runtime you just load
 the generated SWFs defined per user/language based on some params.

 We need to be able to do the same thing in GWT, as now they are asking
 for a Web 2.0 version, so i thought first of loading the module
 dynamically then it turned out that this is a bad idea. Any hint over
 Code Splitting +Deferred Binding?? but will those 2 options work in my
 case?

 i need to load the generated js of a View as if you have created it
 and set its properties per user/language. so if my main Module is the
 application entry point where i have 4 sections to fill in my UIs then
 i need to load the UIs as if they are ready in terms of design and add
 them in their appropriate locations.

 Dunno if i was clear enough in my explanation but comments/suggestions
 are welcome.

 Looking forward to hearing from you.

 best regards,
 Rudolf Michael

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



Re: Initializer blocks

2010-06-22 Thread Olivier Monaco
Not the parent object. Your class is erp.client.Test but the class
of u is erp.client.Test$1. $1 means the first anonymous class of
Test. This is a Java behavior.

Olivier

On Jun 22, 1:22 pm, ahhat...@gmail.com ahhat...@gmail.com wrote:
 Hi,
 I tried to do the following:

 University u = new University()
 {
                 {
                         setName(Ahmed);
                         setPrice(500);
                 }
         };

         University u2 = new University();
         u2.setName(Hassan);
         u2.setPrice(1000);

         Window.alert(u.toString() + \n + u.name + \n + u.getPrice() + \n
 \n + u2.toString() + \n + u2.name + \n + u2.getPrice());

 I go the following result:
 erp.client.tes...@1bafdb4
 Ahmed
 500.0

 erp.client.univers...@1663655
 Hassan
 1000.0

 I don't really understand how did the first object report it self as
 being the parent object.
 May someone explain, please?  And is this behavior GWT specific or
 applies to desktop java too?

 Thank you.

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



Re: Dynamic Module Loading

2010-06-22 Thread Olivier Monaco
I don't know the full story, but maybe the problem is not a technical
one. You can't change technology (Flash = GWT) without doing some
change in your architecture... If they don't want to explore new way,
they must keep their technology.

Olivier

On Jun 22, 12:34 pm, rudolf michael roud...@gmail.com wrote:
 Well this is similar to the Generator/Factory concepts.

 They don't want to go with this approach although i was able to load the
 Factory/Generator class from the server and use it in the client code to
 generate my UIs from the definitions POJOs.

 Since they have a flash background, they want to load an INSTANCE of a UI
 View from the server and plug it in its appropriate location. I have already
 told them that my UIObjects are not serializable and i cannot get them from
 the server but then this might be feasible with native js and static html.

 I am having hard time to convince them that the Generators are not bad.

 regards,
 Rudolf Michael

 On Tue, Jun 22, 2010 at 1:10 PM, Olivier Monaco olivier.mon...@free.frwrote:



  If your need is only to define new view (with few logic), maybe using
  a descriptive language will be better. You can write a templating
  engine using GWT like a XUL interpreter or something like that. This
  is not the best approach for optimized JS (file size, speed...) but
  may be the best compromise. I think GWT compilation is too heavy to be
  done on server, and worse, on the fly.

  Olivier

  On Jun 21, 4:52 pm, ruds roud...@gmail.com wrote:
   Hello there,
   I know that this topic has been circling around for a while and i
   thought to bring it up again just for the sake of discussion and in
   case someone else has found an alternative for it.

   One of our requirements is to be able to load a compiled GWT module at
   runtime, bc we have a compiler unit that runs on the server where you
   can define the UI Components of a UI View and customized it per user
   and language.
   Since we are compiling all the Views through our compiler unit(Not GWT
   Compiler) then we dont want to load the screen dynamically. it is much
   like flex/flash, they do the design through a flash designer and then
   they compile the MXML and generate the SWFs. at runtime you just load
   the generated SWFs defined per user/language based on some params.

   We need to be able to do the same thing in GWT, as now they are asking
   for a Web 2.0 version, so i thought first of loading the module
   dynamically then it turned out that this is a bad idea. Any hint over
   Code Splitting +Deferred Binding?? but will those 2 options work in my
   case?

   i need to load the generated js of a View as if you have created it
   and set its properties per user/language. so if my main Module is the
   application entry point where i have 4 sections to fill in my UIs then
   i need to load the UIs as if they are ready in terms of design and add
   them in their appropriate locations.

   Dunno if i was clear enough in my explanation but comments/suggestions
   are welcome.

   Looking forward to hearing from you.

   best regards,
   Rudolf Michael

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs 
  cr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Modify Java source file at compile time, possible?

2010-06-22 Thread Olivier Monaco
Kevin,

It depends one the which generator can know which interface.

If the generators can know both interfaces, you can create only one
generator. All code generator is pushed to sub classes like
IntrerfaceAWriter and InterfaceBWriter. The generator looks for
several interfaces from the marker interface and call the
corresponding writers.

If one generator (generatorB) can know the other interface (intefaceA)
but not the reverse, it can add a field like:

private InterfaceA wrapped = GWT.create(InterfaceA.class);

Then it implements all InterfaceA's methods and forward call to the
wrapped field.

If none of them can know the other interface (like generators from two
frameworks), you can create an InterfaceC that extends InterfaceA and
InterfaceB. You add a generator that proxy all call to some wrapped
field like in the previous case, but for the two interfaces.

Do you like it?

Olivier

On 14 juin, 16:14, Kevin Qiu kevin.jing@gmail.com wrote:
 e.g.,

 class Foo implements InterfaceA, InterfaceB {

 }

 and in .gwt.xml file, you have
 generate-with class=generatorA
   when-type-assignable class=InterfaceA /
 /generate-with

 generate-with class=generatorB
   when-type-assignable class=InterfaceB /
 /generate-with

 How do I write generatorA and generatorB so that they generate the same
 file, but cascading the effects? Obviously, I'm only looking for general
 directions, not specific details.

 Thanks,

 On Sun, Jun 13, 2010 at 8:10 PM, Olivier Monaco olivier.mon...@free.frwrote:

  Not sure it's a problem. It's depends on you exact use case. Can you
  give me a more exact example?

  Olivier

  On 12 juin, 01:16, Kevin Qiu kevin.jing@gmail.com wrote:
   thanks for the reply. the problem is (I should've pointed out) that my
  Foo
   class is already managed through dependency injection container (gin),
  which
   means there's already a deferred binding implementation generated by
   ginjector.

   On Fri, Jun 11, 2010 at 5:58 PM, Olivier Monaco olivier.mon...@free.fr
  wrote:

Hi Kevin,

You can rewrite your Foo class as:

public class Foo implements MagicClass {
�...@trace
�...@secured
 public void bar() {
 }
}

Then, associate a generator for sub-types of MagicClass and use
GWT.create to instantiate a new Foo.

GWT.create(Foo.class);

So your generator will be called. It can generate a FooImpl class that
extends the Foo class and override the bar method as follow:

public class FooImpl extends Foo {
 public void bar() {
   Log.log(begin of bar);
   try {
     SecurityContext.checkAuthorized();
     super.bar();
   }
   finally {
     Log.log(end of bar);
   }
 }
}

Where Log.log print some logs and SecurityContext.checkAuthorized
throws an error is the user is not authorized. This could be funny and
not really hard to do.

Olivier

On 11 juin, 18:09, Kevin Qiu kevin.jing@gmail.com wrote:
 Hi,

 I know GWT can generate Java source code with deferred binding. But
 sometimes, I don't want to generate a new implementation, but based
  on
some
 annotations, I want to have the ability of injecting code at compile
time.

 e.g., with the class below

 public class Foo {
   @Log
   public void bar() {
     @CheckPermission
     dosomething();
   }

 }

 At compile time, I want to have the ability to get the annotations
available
 on items, and inject code according to my application logic. So here,
  the
 compiler should see:
 public class Foo {
   public void bar() {
     log(begin);
     if (hasPermission()) {
       doSomething();
     } else {
       error();
     }
   }

 }

 with the extra code being injected. I'm wondering if anything in GWT
allows
 me to do that?

--
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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@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

Re: JSNI reference in iframe

2010-06-22 Thread Olivier Monaco
The iframe is the GWT iframe or another one? Do you have a usecase ?

Olivier

On 22 juin, 18:37, randasin r4nd7...@gmail.com wrote:
 I have some JSNI code that assign a function to a variable in the
 window as suggested in JSNI document: Calling a Java Method from
 Handwritten JAvascript (http://code.google.com/webtoolkit/doc/latest/
 DevGuideCodingBasicsJSNI.html#calling)

 The problem is if the JSNI code runs inside an iframe, then the
 function is registered in the top window, and I get a Object expected
 (or Object is null) script error on IE.

 How could I make sure the function is registered in the iframe, and
 not to the window?

-- 
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: Why do I get Native methods do not specify a body when I try to use JSNI?

2010-06-20 Thread Olivier Monaco
Try to add a ; after the JS comment of getUserAgent:

public static native String getUserAgent() /*-{
return navigator.userAgent.toLowerCase()
}-*/;

Olivier

On 20 juin, 17:55, Shedokan shedok...@gmail.com wrote:
 I have this Class:

 package com.testproject.client;

 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.core.client.GWT;

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

         /**
          * This is the entry point method. Initialize you GWT module here.
          */
         public void onModuleLoad() {
                 // Writes Hello World to the module log window.
                 GWT.log(Hello World!, null);
                 GWT.log(getUserAgent(), null);
         }

         public static native String getUserAgent() /*-{
                 return navigator.userAgent.toLowerCase()
         }-*/

 }

 Everything should work fine but somehow I get these three errors:
 Native methods do not specify a body
 Syntax error on token ), { expected after this token
 Syntax error, insert } to complete ClassBody

 Can anyone tell me what is the problem?

 Thanks

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



Re: how to enable scrolling for app using DecoratedTabPanel?

2010-06-17 Thread Olivier Monaco
Hi,

There is two type of layouts: RIA-like and web-page-like. The RIA-like
layout is done using the layout panels. The app stretch to the whole
available space. There is no scrollbars. The web-page-like layout is
done using HTML tags (and some standard panels). The app don't
stretch. If the content is larger than the viewport, scrollbars
appears, like in traditional pages.

Looking at the first screenshot, here is my proposal:

1) The main panel is a DockLayoutPanel attached to RootLayoutPanel.
2) The north slot contains the header.
3) The center slot contains a TabLayoutPanel.

But when you show data (list, form...) you may have no enough space to
show all. Here you start to use web-page-like layout. So:

4) The contain of the contact tab is a LayoutPanel with four slot:
Tighformat, the list, Detail view, Relations.
5) Tighformat, Detail view and Relations are standard panels
(FlowPanel) into ScrollPanels. If there not enough space, a scrollbar
will appear.
6) The list is some sort of DockLayoutPanel with the headers top, the
navigation buttons bottom and the contains of the list in the center
with a scrollbar is needed. The exact implementation depends on the
used widget for the list (SmartGWT, GXT, gwt-incubator...)

Hope this helps.

Think also to invert the color between selected tab and not selected
tab. When i saw the screenshot, I thinking that blue tabs are not the
current tab and white one are the current... The current tab must be
the lighter.

Olivier

On 16 juin, 17:48, ingo ingo.jaec...@googlemail.com wrote:
 hello oliver,

 thank you very much for the link! i want to achieve a page layout
 similar to the google code uihttp://code.google.com/p/honeycrm/:tabs
 on top of the screen and right under the tabs is the module specific
 content. if the content right under the tabs is too big the whole page
 or the content of the tabpanel component should have scrollbars.

 at the moment i do not really care where the scrollbars are - more
 importantly is that there are scrollbars at all :-)

 what do you mean with your suggestion to use a dockpanel instead of a
 docklayoutpanel? should this solve the problem, too? i tried and it
 did not work out for me.

 i will read the stuff in the docs and play around with the different
 containers. would really find a solution for this issue. has anyone
 some sample code that i can have a look at? in the meantime you can
 have a look at my code by browsing through the 
 projecthttp://code.google.com/p/honeycrm/source/browse/#svn/trunk/src/honeyc...

 kind regards,
 ingo

 On 16 Jun., 13:48, Olivier Monaco olivier.mon...@free.fr wrote:

  Do you want:
  1) scroll the whole page? Don't use layouts (*LayoutPanel), there are
  made to avoid scrolling. Did you 
  readhttp://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideUiPanels...

  Try:

  RootPanel
   \_ DockPanel
    \_ DecoratedTabPanel

  2) scroll the content area of the tabs? Add a ScrollPanel in each tab
  content.

  Olivier

  On 16 juin, 09:12, ingo ingo.jaec...@googlemail.com wrote:

   hello everyone,

   i am using the DecoratedTabPanel to split my application into several
   modules (http://honeyyycrm.appspot.com). however, i have currently no
   scrolling at all (in no browser). i read about this in the mailing
   list and it seems like a lot of developers have issues with this
   (especially when they use TabPanels). i experimented with the
   suggestions but i did not yet find a working solution. is there any
   point in the documentation describing what to do to enable scrolling
   when using TabPanels?

   this is the widget that is inserted into the 
   RootLayoutPanel:http://code.google.com/p/honeycrm/source/browse/trunk/src/honeycrm/cl...
   it contains a docklayoutpanel and inserts an instance of TabCenterView
   into 
   itself:http://code.google.com/p/honeycrm/source/browse/trunk/src/honeycrm/cl...

   RootLayoutPanel
    \_ DockLayoutPanel (TabLayout class)
     \_ DecoratedTabPanel (TabCenterView class)

   this is the current hierarchy. now which steps are neccessary to
   enable proper scrolling for the app?

   regards,
   ingo



-- 
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: DockLayoutPanel inside a ScrollPanel

2010-06-17 Thread Olivier Monaco
Yes, Stefan, I missed it. Thanks.

On 16 juin, 18:33, Stefan Bachert stefanbach...@yahoo.de wrote:
  The layout panels are made to avoid scrolling. They must have a fixed
  size.

 The latter sentence is not completly true.
 A LayoutPanel does not calculate its size from children.
 Especially it does not grow when the children grow.

 A Layoutpanel needs to be told which size it has.
 The possibilities are:

 a) to set height and width explicitly (what you notice)
 b) to grow and shrink with its parent (what you missed)

 Stefan Bacherthttp://gwtworld.de

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



Re: MVP questions

2010-06-17 Thread Olivier Monaco
Hi,

Depending on the size of object2, I will use a dedicated presenter
or not. Commonly, I like to have a dedicated one so I can easily reuse
it, extends it... and, more important, I have more encapsulation,
reducing the complexity of my code.

Olivier

On 16 juin, 17:20, Bilousme julien.dram...@gmail.com wrote:
 Hello all,

 I need some help to check if my design I choose is correct.
 Imagine I have a data model like that :
  - An object1 containing a list of many object2

 Imagine now I want that my screen displays info of object1 and the
 list of object2 inside a tabpanel. When you click on a tab, you
 display the info of the selected object2.

 What is the best way to implement that ?
 1) only one couple of presenter/view for object1 and this couple
 manages the display of object2 in each tab
 2) one presenter/view object for object1 and one presenter/view for
 each instance of object2 ?

 in other words, do I have one couple of presenter/view by object
 model ?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-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: Using the addAndReplaceElement to add Widgets

2010-06-17 Thread Olivier Monaco
Hi,

What do you think about that way :

SearchForm.ui.xml
g:FormPanel styleName=search form action= method=post
  g:HTMLPanel
fieldset
  ...
/fieldset
  /g:HTMLPanel
/g:FormPanel


SearchForm.java
public class SearchForm extends Composite {
  interface Binder extends UiBinder...
  private static final Binder binder = GWT.create...;

  private FormPanel form;

  public SearchForm() {
form = binder.createAndBind(this);
initWidget(form);
  }
}


This ensures you don't break the event handling. You can also replace
input.. by g:TextBox... and button... by g:Button These
two classes generate clean HTML.

If you really want to continue with your way, you have to deal with
widgets internal like sinkEvents, adopt, onAttach...

Olivier

On 16 juin, 19:13, Thiago Miranda de Oliveira thiago...@gmail.com
wrote:
 Hi.. Here in my company we've decided to adopt the GWT for a working
 project but we are facing a huge barrier. Gwt has it's own widgets but
 they won't be used for their HTML/CSS produced that is almost
 impossible to transform in our design and HTML/CSS needs.
 So we've decided to create our own Widgets using the Ui Binder. So
 I've tried to do this:
 panelSearch.ui.xml:

 g:HTMLPanel ui:field=searchForm
                 form class=search form action= method=post
                         fieldset
                                 legend class=hiddenSearch results/legend
                                 div class=grid-12-12
                                         label class=form-lblBusca:/label
                                         input type=text id=search-field 
 title=Busca tabindex=
 class=form-txt form-small /
                                         label class=form-lblFiltrar por 
 data/label
                                         input type=text title=Filtrar por 
 data tabindex=
 class=form-txt form-date /
                                         input type=text title=até 
 tabindex= class=form-txt form-
 date /
                                         button ui:field=buttonOk 
 type=submit title=Ok tabindex=
 class=form-button form-left buttonok/button
                                         a title=Adicionar projeto 
 href=upload-projeto.html
 class=add-project button rightspanAdicionar projeto/span/a
                                 /div
                         /fieldset
                 /form
   /g:HTMLPanel

 And then I've created a Widget that extends the FormPanel and tried,
 mapped it and tried to use the getWidgetContainer inside the
 panelSearch.java to replace it with my class that extends the
 FormPanel. It replaced well but I can't get the events ( like
 submitHandler ). How can I do that? Is there a way?

 Thanks for the attention
 Cheers

-- 
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: Problem with RequestBuilder

2010-06-17 Thread Olivier Monaco
Hi,

Configure your backend server to serve the folder where your GWT
HTML page is (and the compiled JS). Then, open this page in your
browser. The URL may be something like:

http://localhost:88/mypage.html

This load the compiled version of your application. Add a parameter
named gwt.codesvr with value 127.0.0.1:9997 and the dev mode will
be used.

http://localhost:88/mypage.html?gwt.codesvr=127.0.0.1:9997

Now you can use the dev mode and have not SOP probem ;)

Olivier

On 16 juin, 15:16, alian rea aliandre...@gmail.com wrote:
 Hallo guys, i'm new of this group.
 I'm new developer for GWT 2.0 and SmartGWT.
 I've a problem with RequestBuilder. There are one frontend and one
 backend. The first is an java GWT application, the second is a PHP
 scripts, and they speak with JSON. Now The first application is in
 port  and the backend is in port 88, in the identical domain, and
 the rule of SOP forbid the comunication, with the onsuccess method of
 Request callback. The statuscode is 0, and the getText() is .
 How can i do?
 Help please thank you.

 Andrea

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



Re: GWT applet problem

2010-06-16 Thread Olivier Monaco
Hi,

The easiest way is not an frame... you will have many issue. You can
create a Widget backing by an object tag. Or you can try some library
like http://code.google.com/p/gwtai/.

Olivier

On 16 juin, 13:17, mariyan nenchev nenchev.mari...@gmail.com wrote:
 I said the easiest way to do 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-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: how to enable scrolling for app using DecoratedTabPanel?

2010-06-16 Thread Olivier Monaco
Do you want:
1) scroll the whole page? Don't use layouts (*LayoutPanel), there are
made to avoid scrolling. Did you read
http://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideUiPanels.html?

Try:

RootPanel
 \_ DockPanel
  \_ DecoratedTabPanel

2) scroll the content area of the tabs? Add a ScrollPanel in each tab
content.

Olivier

On 16 juin, 09:12, ingo ingo.jaec...@googlemail.com wrote:
 hello everyone,

 i am using the DecoratedTabPanel to split my application into several
 modules (http://honeyyycrm.appspot.com). however, i have currently no
 scrolling at all (in no browser). i read about this in the mailing
 list and it seems like a lot of developers have issues with this
 (especially when they use TabPanels). i experimented with the
 suggestions but i did not yet find a working solution. is there any
 point in the documentation describing what to do to enable scrolling
 when using TabPanels?

 this is the widget that is inserted into the 
 RootLayoutPanel:http://code.google.com/p/honeycrm/source/browse/trunk/src/honeycrm/cl...
 it contains a docklayoutpanel and inserts an instance of TabCenterView
 into 
 itself:http://code.google.com/p/honeycrm/source/browse/trunk/src/honeycrm/cl...

 RootLayoutPanel
  \_ DockLayoutPanel (TabLayout class)
   \_ DecoratedTabPanel (TabCenterView class)

 this is the current hierarchy. now which steps are neccessary to
 enable proper scrolling for the app?

 regards,
 ingo

-- 
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: DockLayoutPanel inside a ScrollPanel

2010-06-16 Thread Olivier Monaco
Elben,

The layout panels are made to avoid scrolling. They must have a fixed
size. They use the whole window and updates there content viewport as
the window is resized. If their content is too large to be shown, a
part of it will be hidden (http://code.google.com/intl/fr/webtoolkit/
doc/latest/DevGuideUiPanels.html).

So, as Gal said, fix the size of you DockLayoutPanel. If it's not an
option for you, you may forgot layouts. What do you try to do?

Olivier

On 15 juin, 01:42, Elben Shira elbensh...@gmail.com wrote:
 Hi,

 I have a layout defined by:
 - ...
   - ScrollPanel
     - DockLayoutPanel
       - north
       - west
       - center
       - east

 The problem is that the dock layout panel is cut off from the window;
 the scroll bars don't appear. I can force the scroll bars to appear by
 setting the height of both panels to some pixel, but this is obviously
 not a useful solution.

 Any hints?

-- 
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: Bookmarklet with GWT

2010-06-14 Thread Olivier Monaco
My linker generate .cache.js files instead of .nocache.js (in fact it
use XsLinker). Then, it create a bootstrap script (the .nocache.js)
derived from the one for XsLinker.

But there's a limitation. The bootstrap needs the base path of the GWT
folder (the one with .cache.js files). To find it, the bootstrap needs
to find the script tag of itself. You must add an id attribute to it
containing the name of your module followed by Loader. If your
bootstrap script is myscript.cache.js, the id must be
myscriptLoader.

Then your bookmarklet is:
javascript:(function(){var
%20t=document.createElement('script');t.id='myscriptLoader';t.type='text/
javascript';t.src='http://www.server.com/myscript.nocache.js?
_bk_='+t.id+'_nocache='+(new
%20Date()).valueOf();document.getElementsByTagName('head')
[0].appendChild(t);})();

Olivier

On 14 juin, 08:17, dino dinos...@gmail.com wrote:
 yes, you misunderstood me :p I don't speak english and have sometimes
 trouble explaining what I wan't :p
 but that sentence is non-trivial and you already answered what I
 needed to know

 Sorry that I called your tutorial not good but It looked rather
 confusing. It looks like you are doing some buggy changes, it only
 looks that way. It kept me back for that reason. Maybe I'll better
 reread it and write a java program to automate it.

 Oh and I have to check out that plugin Olivier pointed out. I'm just
 curious what that plugin does apart from what keremTyriaky posted.

 If you ask my opinion about the end product: Never seen any bugs,
 works very good and is handy if I want to understand some sentences,
 thanks. But I think there are more useful uses then a translator.

 On Jun 14, 1:27 am, KeremTiryaki keremtiry...@gmail.com wrote:

   I want to write my own bookmarklet in gwt and I didn't found any good
   tutorial online.
   This guy managed to do so, I want to know why.
   And yes, most browsers support bookmarklets

  5 months ago, I wrote a 
  tutorialhttp://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and...
  but you are right, it is not a good one :) I will try to make a video
  about it for better explain.

  And Yes bookmarklets could be a BigDevil. These kind of tools must be
  open source. They are only JS, They are already open source. But I
  will share the gwt codes as soon as possible.

    how do you create a bookmarklet in gwt? like a casual gwt project?

  Yes it is casual gwt project. but you need to do something after
  compile java codes. There is some trick about server
  communication(http://code.google.com/webtoolkit/doc/latest/tutorial/
  Xsite.html). I explained it in my blog post, but I will give more info
  about it...

   Dino:This guy managed to do so, I want to know why.

  Because I need a translate tool like that :) and am I misunderstood
  you?

  Thanks a lot



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-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: Bookmarklet with GWT

2010-06-14 Thread Olivier Monaco
It doesn't support hosted mode. I have one project with standard
linker for debugging and on project with bookmarklet linker.

Olivier

On 14 juin, 13:33, dino dinos...@gmail.com wrote:
 how do you do the debugging?
 It doesn't work in hosted mode or does it?

 On 14 jun, 09:16, Olivier Monaco olivier.mon...@free.fr wrote:

  My linker generate .cache.js files instead of .nocache.js (in fact it
  use XsLinker). Then, it create a bootstrap script (the .nocache.js)
  derived from the one for XsLinker.

  But there's a limitation. The bootstrap needs the base path of the GWT
  folder (the one with .cache.js files). To find it, the bootstrap needs
  to find the script tag of itself. You must add an id attribute to it
  containing the name of your module followed by Loader. If your
  bootstrap script is myscript.cache.js, the id must be
  myscriptLoader.

  Then your bookmarklet is:
  javascript:(function(){var
  %20t=document.createElement('script');t.id='myscriptLoader';t.type='text/
  javascript';t.src='http://www.server.com/myscript.nocache.js?
  _bk_='+t.id+'_nocache='+(new
  %20Date()).valueOf();document.getElementsByTagName('head')
  [0].appendChild(t);})();

  Olivier

  On 14 juin, 08:17, dino dinos...@gmail.com wrote:

   yes, you misunderstood me :p I don't speak english and have sometimes
   trouble explaining what I wan't :p
   but that sentence is non-trivial and you already answered what I
   needed to know

   Sorry that I called your tutorial not good but It looked rather
   confusing. It looks like you are doing some buggy changes, it only
   looks that way. It kept me back for that reason. Maybe I'll better
   reread it and write a java program to automate it.

   Oh and I have to check out that plugin Olivier pointed out. I'm just
   curious what that plugin does apart from what keremTyriaky posted.

   If you ask my opinion about the end product: Never seen any bugs,
   works very good and is handy if I want to understand some sentences,
   thanks. But I think there are more useful uses then a translator.

   On Jun 14, 1:27 am, KeremTiryaki keremtiry...@gmail.com wrote:

 I want to write my own bookmarklet in gwt and I didn't found any good
 tutorial online.
 This guy managed to do so, I want to know why.
 And yes, most browsers support bookmarklets

5 months ago, I wrote a 
tutorialhttp://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and...
but you are right, it is not a good one :) I will try to make a video
about it for better explain.

And Yes bookmarklets could be a BigDevil. These kind of tools must be
open source. They are only JS, They are already open source. But I
will share the gwt codes as soon as possible.

  how do you create a bookmarklet in gwt? like a casual gwt project?

Yes it is casual gwt project. but you need to do something after
compile java codes. There is some trick about server
communication(http://code.google.com/webtoolkit/doc/latest/tutorial/
Xsite.html). I explained it in my blog post, but I will give more info
about it...

 Dino:This guy managed to do so, I want to know why.

Because I need a translate tool like that :) and am I misunderstood
you?

Thanks a lot



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-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: Bookmarklet with GWT

2010-06-13 Thread Olivier Monaco
Hi Kerem,

Your way to create a bookmarklet is not trivial. If you want a easier
way, you can try my bookmarklet linker (http://code.google.com/p/tyco/
source/browse/#svn/trunk/tyco-gwt/src/main/com/googlecode/tyco/gwt/
bookmarklet). Then, you just have to write a bookmarklet that load
the .nocache.js file.

Olivier

On 14 juin, 01:27, KeremTiryaki keremtiry...@gmail.com wrote:
  I want to write my own bookmarklet in gwt and I didn't found any good
  tutorial online.
  This guy managed to do so, I want to know why.
  And yes, most browsers support bookmarklets

 5 months ago, I wrote a 
 tutorialhttp://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and...
 but you are right, it is not a good one :) I will try to make a video
 about it for better explain.

 And Yes bookmarklets could be a BigDevil. These kind of tools must be
 open source. They are only JS, They are already open source. But I
 will share the gwt codes as soon as possible.

   how do you create a bookmarklet in gwt? like a casual gwt project?

 Yes it is casual gwt project. but you need to do something after
 compile java codes. There is some trick about server
 communication(http://code.google.com/webtoolkit/doc/latest/tutorial/
 Xsite.html). I explained it in my blog post, but I will give more info
 about it...

  Dino:This guy managed to do so, I want to know why.

 Because I need a translate tool like that :) and am I misunderstood
 you?

 Thanks a lot

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-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: Modify Java source file at compile time, possible?

2010-06-13 Thread Olivier Monaco
Not sure it's a problem. It's depends on you exact use case. Can you
give me a more exact example?

Olivier

On 12 juin, 01:16, Kevin Qiu kevin.jing@gmail.com wrote:
 thanks for the reply. the problem is (I should've pointed out) that my Foo
 class is already managed through dependency injection container (gin), which
 means there's already a deferred binding implementation generated by
 ginjector.

 On Fri, Jun 11, 2010 at 5:58 PM, Olivier Monaco olivier.mon...@free.frwrote:

  Hi Kevin,

  You can rewrite your Foo class as:

  public class Foo implements MagicClass {
  �...@trace
  �...@secured
   public void bar() {
   }
  }

  Then, associate a generator for sub-types of MagicClass and use
  GWT.create to instantiate a new Foo.

  GWT.create(Foo.class);

  So your generator will be called. It can generate a FooImpl class that
  extends the Foo class and override the bar method as follow:

  public class FooImpl extends Foo {
   public void bar() {
     Log.log(begin of bar);
     try {
       SecurityContext.checkAuthorized();
       super.bar();
     }
     finally {
       Log.log(end of bar);
     }
   }
  }

  Where Log.log print some logs and SecurityContext.checkAuthorized
  throws an error is the user is not authorized. This could be funny and
  not really hard to do.

  Olivier

  On 11 juin, 18:09, Kevin Qiu kevin.jing@gmail.com wrote:
   Hi,

   I know GWT can generate Java source code with deferred binding. But
   sometimes, I don't want to generate a new implementation, but based on
  some
   annotations, I want to have the ability of injecting code at compile
  time.

   e.g., with the class below

   public class Foo {
     @Log
     public void bar() {
       @CheckPermission
       dosomething();
     }

   }

   At compile time, I want to have the ability to get the annotations
  available
   on items, and inject code according to my application logic. So here, the
   compiler should see:
   public class Foo {
     public void bar() {
       log(begin);
       if (hasPermission()) {
         doSomething();
       } else {
         error();
       }
     }

   }

   with the extra code being injected. I'm wondering if anything in GWT
  allows
   me to do that?

  --
  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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Modify Java source file at compile time, possible?

2010-06-11 Thread Olivier Monaco
Hi Kevin,

You can rewrite your Foo class as:

public class Foo implements MagicClass {
  @Trace
  @Secured
  public void bar() {
  }
}

Then, associate a generator for sub-types of MagicClass and use
GWT.create to instantiate a new Foo.

GWT.create(Foo.class);

So your generator will be called. It can generate a FooImpl class that
extends the Foo class and override the bar method as follow:

public class FooImpl extends Foo {
  public void bar() {
Log.log(begin of bar);
try {
  SecurityContext.checkAuthorized();
  super.bar();
}
finally {
  Log.log(end of bar);
}
  }
}

Where Log.log print some logs and SecurityContext.checkAuthorized
throws an error is the user is not authorized. This could be funny and
not really hard to do.

Olivier

On 11 juin, 18:09, Kevin Qiu kevin.jing@gmail.com wrote:
 Hi,

 I know GWT can generate Java source code with deferred binding. But
 sometimes, I don't want to generate a new implementation, but based on some
 annotations, I want to have the ability of injecting code at compile time.

 e.g., with the class below

 public class Foo {
   @Log
   public void bar() {
     @CheckPermission
     dosomething();
   }

 }

 At compile time, I want to have the ability to get the annotations available
 on items, and inject code according to my application logic. So here, the
 compiler should see:
 public class Foo {
   public void bar() {
     log(begin);
     if (hasPermission()) {
       doSomething();
     } else {
       error();
     }
   }

 }

 with the extra code being injected. I'm wondering if anything in GWT allows
 me to do that?

-- 
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: Synchronous Calls with RPC??

2010-06-10 Thread Olivier Monaco
I'm okay for blocking one part of the application or the whole for
global processing (login...). What I dislike is application blocking
me when I just ask for a little component to upgrade. Like if you have
a iGoogle page and click refresh on one widget block all widgets ;).

Olivier

On 10 juin, 03:14, Craigo craig...@gmail.com wrote:
 +1.

 When the user presses load / submit / ... on my app, I enable the
 glass pane, and they have to wait until the submit has completed
 successfully.  I see nothing wrong with this approach:

 PopupPanel loadingDialog = new PopupPanel();
 loadingDialog.setWidget(loadingImageAnimation);
 loadingDialog.setGlassEnabled(true);
 loadingDialog.center();

 .. do the work

 onSuccess and onFailure callback
 loadingDialog.hide();

 On Jun 10, 9:28 am, Carl Pritchett bogusggem...@gmail.com wrote:

   Your proposal is interesting. But as a user, if I have to wait, I
   leave... So many be an application needing some wait a minute popup
   is not a good approach for the future.

  I wouldn't popup (block user interaction) over the whole page! Just
  the component that needs to load. In fact you don't even need to block
  user interaction. I just do it in my application because (for example)
  the user has clicked refresh on a component and any interaction with
  the refreshing component would be invalid. So in my case partial
  blocking the UI is better for the user - they can go on interacting
  with other parts of the app (we have a multiple portal like windows)

  Carl.



-- 
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: Using Javascript Overlays vs. Manually setting up POJO instances?

2010-06-10 Thread Olivier Monaco
You have also some framework like piriti allowing easy mapping between
JSON and Java object. But I don't like them because their overhead. I
use another approach.

My model is made of interfaces. I share the interfaces between the
server and GWT. For GWT, I have a generator that automatically
implements the interface as a wrapper around the JSO. This wrapper is
a zero-overhead implementation (just method forward).

You can find my generator here if it can help you:
http://code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/main/com/googlecode/tyco/gwt/tikray
And you have some unittests here:
http://code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/test/com/googlecode/tyco/gwt/tikray

Olivier

On 10 juin, 01:06, rhodebump rhodeb...@gmail.com wrote:
 I did some reading up on RPC.  Sounds like it would be perfect except
 for the face that it is limited by the Same Origin Policy, so I can't
 use it.

 I wish we could do an RPC with JsonpRequestBuilder

 Thanks for your insight, you have convinced me to do the Javascript
 Overlays.  I do like type safety and it sounds like it would be more
 efficient.

 Phillip

 On Jun 9, 5:52 pm, Sripathi Krishnan sripathi.krish...@gmail.com
 wrote:

  I am assuming you have a strong reason not to use standard RPC - because if
  you really have POJO's on the server side, reusing the same objects on the
  client side should be a breeze.

  It always makes sense to Javascript Overlays, otherwise you loose type
  safety and all the other advantages java has over javascript. It is a pain
  to maintain two versions for the same entity, but the advantages far
  outweigh the inconvenience. You can perhaps even build a small utility that
  generates the overlays -- shouldn't be too difficult.

  And finally, if it eases your pain, most people end up having DTOs and Model
  objects *even if* they use regular RPC. That's because the POJO's you have
  on the server may be a complex hierarchy of objects; what you want on the
  client side is usually pretty simple and doesn't have deep hierarchies.

  --Sri

  On 10 June 2010 02:56, rhodebump rhodeb...@gmail.com wrote:

   I have several Java classes that I am using on the serverside, and I
   am using these same classes to serialize the JSON stream back to my
   GWT application.  I am using the JsonpRequestBuilder to call my
   service and it is successfully returning a JavascriptObject.

   What is the recommended approach to getting my objects from the json
   response?, should it be a) coerce my JavaScriptObject into a string
   and use the JsonParser, or b) write a 2nd implementation of my classes
   using Javascript overlays?

   I don't really like either approach, one option means having 2 types
   of objects that I would need to keep in sync (the pojo and the
   Javascript overlay) and the other way means I have to traverse the
   Json myself, populating my object glyph manually.
   Either way, ouch.

   Thanks for listening,
   Phillip

   --
   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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.



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



Re: Using JavaScript Overlay Types for Nested JavaScriptObjects

2010-06-10 Thread Olivier Monaco
Hi,

Imagine you have this in your HTML page:
-
html
  ...
  script
window.data = { prop1 : { prop2: 42 } };
  /script
  ...
/hmtl
-

First create a JSO for the prop1 value:
class InnerJSO extends JSO {
  protected InnerJSO() {}
  public native int getProp2() /*-{ return this.prop2; }-*/;
}

Second create the outer JSO (the data value):
class OuterJSO extends JSO {
  protected OuterJSO() {}
  public native InnerJSO getProp1() /*-{ return this.prop1; }-*/;
}

Finally create a method that returns data:
public native OuterJSO getData() /*-{ return $wnd.data; }-*/;

Okay? Do you need more explanation?

Olivier

On 9 juin, 01:58, bluedes bluediamond...@gmail.com wrote:
 i also have the same problem..

 i have this setup:

 public class Entry extends JavaScriptObject
 {
         protected Entry() { }
         public final native String getWidth() /*-{ return
 this.Width; }-*/;
         public final native String getHeight()  /*-{ return
 this.Height;  }-*/;

 }

 public class ResponseEntries extends JavaScriptObject
 {
         protected ResponseEntries() { }
         public final native String getStatus() /*-{ return
 this.Status; }-*/;
         public final native JsArrayEntry getEntries()  /*-{ return
 this.Entries;  }-*/;

 }

 the json string looks like this, but i can't seem to create the proper
 js overlay type.. how to nest javascriptobjects??

 { Status:Success, Entries:
 [ { Width:10, Height:20 }, { Width:15, Height:25 } ] }

 On May 31, 9:22 pm, powwow jimmy.w...@gmail.com wrote:

  I have this in my html and I can use JavaScriptOverlaytypesno
  problem and it works:

   script
          var properties = {width:640, height:480};
   /script

  public class Properties extends JavaScriptObject
  {
          protected Properties() { }

          public final native String getWidthString() /*-{ return this.width; 
  }-
  */;
          public final native String getHeightString()  /*-{ return
  this.height;  }-*/;

  }

  However, when I start nesting objects like below I do not know how to
  extract the property object from properties.

   script
          var properties = {property:{canvasWidth:1920, canvasHeight:
  1200, width:640, height:480, fps:15, bgcolor:#FF}};
   /script

  What do I need to do to get the properties object, and then get to
  the property object?



-- 
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: Using Javascript Overlays vs. Manually setting up POJO instances?

2010-06-10 Thread Olivier Monaco
My TNativeList is a list-like wrapper around a JS array (http://
code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/main/com/
googlecode/tyco/gwt/tikray/client/TNativeList.java). It is used by
TList, a List implementation that maps a JS array to a List without
(too much) overhead.

The following unittest is an example of ListString member:
http://code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/test/com/googlecode/tyco/gwt/tikray/client/collection/GwtTestCollection.java
. I plan to reduce this code be providing a default list where the
list if null.

Currently, my code allows the members of:
- primitive types (int, boolean...)
- wrapper types (Integer, Boolean...)
- String
- Collection/List of wrapper types or String
- Collection/List of JSO
- Collection/List of TObject (something generated by my generator)

Adding Map is not so hard, I just have no need it before ;).

Olivier

On 10 juin, 12:53, Roger Studner rstud...@gmail.com wrote:
 The only problem I found with this interface technique (which I immediately 
 wanted) was this:

 public interface MyEntity {
    ListString getNames();

 }

 The javascript overlay type has to deal in JSArray's, the server can't etc.

 So for all lists/collections I found it broke down pretty quick

 Roger

 On Jun 10, 2010, at 5:55 AM, Olivier Monaco wrote:

  You have also some framework like piriti allowing easy mapping between
  JSON and Java object. But I don't like them because their overhead. I
  use another approach.

  My model is made of interfaces. I share the interfaces between the
  server and GWT. For GWT, I have a generator that automatically
  implements the interface as a wrapper around the JSO. This wrapper is
  a zero-overhead implementation (just method forward).

  You can find my generator here if it can help you:
 http://code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/main/c...
  And you have some unittests here:
 http://code.google.com/p/tyco/source/browse/trunk/tyco-gwt/src/test/c...

  Olivier

  On 10 juin, 01:06, rhodebump rhodeb...@gmail.com wrote:
  I did some reading up on RPC.  Sounds like it would be perfect except
  for the face that it is limited by the Same Origin Policy, so I can't
  use it.

  I wish we could do an RPC with JsonpRequestBuilder

  Thanks for your insight, you have convinced me to do the Javascript
  Overlays.  I do like type safety and it sounds like it would be more
  efficient.

  Phillip

  On Jun 9, 5:52 pm, Sripathi Krishnan sripathi.krish...@gmail.com
  wrote:

  I am assuming you have a strong reason not to use standard RPC - because 
  if
  you really have POJO's on the server side, reusing the same objects on the
  client side should be a breeze.

  It always makes sense to Javascript Overlays, otherwise you loose type
  safety and all the other advantages java has over javascript. It is a pain
  to maintain two versions for the same entity, but the advantages far
  outweigh the inconvenience. You can perhaps even build a small utility 
  that
  generates the overlays -- shouldn't be too difficult.

  And finally, if it eases your pain, most people end up having DTOs and 
  Model
  objects *even if* they use regular RPC. That's because the POJO's you have
  on the server may be a complex hierarchy of objects; what you want on the
  client side is usually pretty simple and doesn't have deep hierarchies.

  --Sri

  On 10 June 2010 02:56, rhodebump rhodeb...@gmail.com wrote:

  I have several Java classes that I am using on the serverside, and I
  am using these same classes to serialize the JSON stream back to my
  GWT application.  I am using the JsonpRequestBuilder to call my
  service and it is successfully returning a JavascriptObject.

  What is the recommended approach to getting my objects from the json
  response?, should it be a) coerce my JavaScriptObject into a string
  and use the JsonParser, or b) write a 2nd implementation of my classes
  using Javascript overlays?

  I don't really like either approach, one option means having 2 types
  of objects that I would need to keep in sync (the pojo and the
  Javascript overlay) and the other way means I have to traverse the
  Json myself, populating my object glyph manually.
  Either way, ouch.

  Thanks for listening,
  Phillip

  --
  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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr

Re: Using jqPlot library (javascript chart) with the MVP pattern

2010-06-10 Thread Olivier Monaco
Because the array is bound to the sub-frame used by GWT.

When you create an array using [], the Array function is called. This
is the same as new Array(). Then the following condition returns
true: [].constructor == Array.

But, there is an Array function for each frame. If you create an array
in one frame, and use the same comparison in another, it will returns
false.

You must create your array using new $wnd.Array(). That's another
reason to do a real wrapper ;).

Olivier

On 10 juin, 14:06, Rizen vianney.dep...@gmail.com wrote:
 I'm a stupid boy... I forgot to replace ALL $.jqplot() by $wnd.
 $.jqplot();

 It's an improvement, but now the error has changed by :

 com.google.gwt.core.client.JavaScriptException: (String): Improper
 Data Array

 The table works in a HTML page, so I don't know why not here :/

 I'm going to continue my research.
 Thanks a lot for your help.

-- 
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: Problem in ListBox

2010-06-09 Thread Olivier Monaco
Hi,

Try using a self-closing tag.

g:ListBox ui:field=.../

Olivier

On 8 juin, 08:32, Kuldeep Poonia kpoon...@gmail.com wrote:
 Hi all,

 I hava a variable name in Class Base and want to bind this to the
 listbox. so i use

 @ListBox name.
  and in ui.xml i use
 g:ListBox ui:field='name'/g:ListBox/td

 but it shows error that list cannot have hasText ot HasValue super
 interface.

 Plz Help whar can i do.

-- 
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: CSS theming

2010-06-09 Thread Olivier Monaco
David,

I use something like that. To easy manage my CSS class names, I use a
generator similar to the CssResource-generator. I define an interface
extending Identifiers with one method for each CSS class name:

interface MyCssClasses
extends Identifiers
{
  public String firstClass();

  public String secondClass();
}

My generator create an implementation that returns the name of the
method for each one. This allow refractoring and avoid typo-error. I
also added some annotation to allow name override (@Identifier) and
case transformation (@Transform). I also use it each time an
identifier is needed.

You can find my code here:
http://code.google.com/p/tyco/source/browse/#svn/trunk/tyco-gwt/src/main/com/googlecode/tyco/gwt/user

Hope this helps,

Olivier

On 8 juin, 21:42, David Grant davidgr...@gmail.com wrote:
 Any suggestions on how to do theming, ie. to allow a new theme to be created
 in the future as a separate css file that can be switched on/off at runtime.
 I also don't want just global CSS though, I want CSS scope as local as
 possible but I want to be able to expose some CSS to be themable. Here's my
 idea about how to organize our CSS to do this:

 1) Shared CSS file - contain some styles that are shared across all widgets
 like fonts
 2) Local CSS stuff - stuff that applies only to 1 widget or so, this will be
 inside the widget's ui.xml file, or in a separate css file and referened
 from the ui.xml file
 3) Theme CSS file - there will be several, all of which extend from some
 interface that defines classes that can be then modified by a theme's css
 file

 So within any one ui.xml file I might be referring to some local css, the
 shared css, or the theme's css.

 Any comments?

-- 
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: JSONParser can't parse some unescaped unicode characters

2010-06-09 Thread Olivier Monaco
Hi,

JSONParser must only be used with trusted JSON because it uses
eval(). Thing about using a real JSON parser. This will avoid
problem like this one.

As a JSON parser example, you can see my port of the JavaScript parser
from json.org: 
http://code.google.com/p/tyco/source/browse/#svn/trunk/tyco-gwt/src/main/com/googlecode/tyco/gwt/client/json

It uses the native JSON parser if available, and uses a JavaScript
implementation otherwise. I know someone try to do something similar
into GWT but had some issues. I hope a true JSON parser will come
soon.

Olivier

On 8 juin, 10:15, Boris Granveaud bgran...@gmail.com wrote:
 @gmail.com wrote:
  On Jun 7, 11:00 am, Boris Granveaud bgran...@gmail.com wrote:
   Hi,

   It seems that JSONParser doesn't like some unicode characters if they
   are not escaped with \u:

   public class Test implements EntryPoint {
     public void onModuleLoad() {
       for (char c = 0x2000; c  0x2050; c++) {
         String str = {\string\:\ + c + \};
         try {
           JSONValue json = JSONParser.parse(str);
         } catch (Exception e) {
           System.out.println(JSON parse error char= +
   Integer.toHexString((int) c));
         }
       }
     }

   }

   In GWT 2.0.3 emulator, I've got the following results:

   - Chrome 5.0 and FF 3.6: error with character 0x2028 and 0x2029
   - IE 8.0: no error

   It works if I escape the characters with \u2028 and \u2029.

  This is because GWT for now uses eval() to parse JSON, and U+2028
  and U+2029 are line terminators in JavaScript (per spec).
  Quoting ECMASCript 5, which defines JSON.parse:
  JSON uses a more limited set of white space characters than
  WhiteSpace and allows Unicode code points U+2028 and U+2029 to
  directly appear in JSONString literals without using an escape
  sequence.

   I'm using Jackson on server-side to generate the JSON string which is
   sent to my GWT application and it doesn't escape by default these
   characters. As a workaround, I've implemented a Jackson custom
   serializer.

  Jackson is right, as these aren't special characters in JSON, but on
  the other hand, it could escape them to cope with web apps that eval()
  the result instead of JSON.parse()ing it.

 if someone is interested by the workaround, it is now on Jackson 
 wiki:http://wiki.fasterxml.com/JacksonSampleQuoteChars

 there are also several issues regarding escaping in JIRA:

 http://jira.codehaus.org/browse/JACKSON-102http://jira.codehaus.org/browse/JACKSON-262http://jira.codehaus.org/browse/JACKSON-219

 Boris.

-- 
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: Problem in ListBox

2010-06-09 Thread Olivier Monaco
Please give a small use case.

On 9 juin, 11:51, Kuldeep Poonia kpoon...@gmail.com wrote:
 Hi Olivier
 Thanks for Reply. But same problem comming
 The UiField com.google.gwt.user.client.ui.ListBox itemName does not
 have a HaxText or HasValue super-interface

 On Jun 9, 11:14 am, Olivier Monaco olivier.mon...@free.fr wrote:

  Hi,

  Try using a self-closing tag.

  g:ListBox ui:field=.../

  Olivier

  On 8 juin, 08:32, Kuldeep Poonia kpoon...@gmail.com wrote:

   Hi all,

   I hava a variable name in Class Base and want to bind this to the
   listbox. so i use

   @ListBox name.
    and in ui.xml i use
   g:ListBox ui:field='name'/g:ListBox/td

   but it shows error that list cannot have hasText ot HasValue super
   interface.

   Plz Help whar can i do.

-- 
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: Using jqPlot library (javascript chart) with the MVP pattern

2010-06-09 Thread Olivier Monaco
Try to replace your $.jqplot by $wnd.$.jqplot. The window object
where the JSNI is run is not the main window. You can access it
through $wnd.

Olivier

On 9 juin, 11:39, Rizen vianney.dep...@gmail.com wrote:
 Finally I think I'm going to try with the JavaScriptObject class,
 cause I can cast it in Element object.

 public class CallChartView extends Widget implements
 CallChartPresenter.Display {

         public CallChartView() {
                 setElement(Element.as(createChart()));
         }

         public native JavaScriptObject createChart() /*-{
                 line1 = [1,4,9, 16];
                 line2 = [25, 12.5, 6.25, 3.125];

                 plot = $.jqplot('chart1', [line1, line2], {
                        legend:{show:true, location:'ne'},title:'Bar
 Chart',
                        series:[
                              {label:'Profits', renderer:
 $.jqplot.BarRenderer},
                              {label:'Expenses', renderer:
 $.jqplot.BarRenderer}
                        ],
                        axes:{
                              xaxis:{renderer:$.jqplot.CategoryAxisRenderer},
                              yaxis:{min:0}
                        }
                 });
                 return plot;
         }-*/;

 }

 But now I have an error from the GWT console : $ is not defined. I
 have already tried to change the javascript configuration but the
 problem is always present.

-- 
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: Using jqPlot library (javascript chart) with the MVP pattern

2010-06-09 Thread Olivier Monaco
Okay, next try (I've read your post this time ;)).

You want to cast a JavaScriptObject to an Element. You can... but it's
a bad idea. A Widget needs an Element because it offer some DOM
manipulation. Providing a JSO may lead to strange behavior. You need
to write a clean GWT wrapper around jqPlot.

For your current problem, $ is not defined, are you sure you have
included the jqPlot library? Using the FireBug's console, can you
access the $ (try typeof($))?

Olivier

On 9 juin, 13:04, Rizen vianney.dep...@gmail.com wrote:
 I've already tried but it's exactly the same problem.

 Here is a part of the error log :

 [...]
 com.google.gwt.core.client.JavaScriptException: (ReferenceError): $ is
 not defined
  fileName:http://127.0.0.1:
  lineNumber: 4
  stack: ()@http://127.0.0.1::4
 [...]

-- 
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: Using jqPlot library (javascript chart) with the MVP pattern

2010-06-09 Thread Olivier Monaco
For the $, maybe the library is not loaded when you try to create
your chart.

As I told before, you need to write a wrapper. This wrapper create the
div needed by jqPlot and add an unique ID to it. This ID is used as
the first argument to jqPlot JavaScript function. But you can't
create your chart in your Widget constructor. The div is not attached
to the DOM so jqPlot will no find it. You need to create your chart
when onLoad is called. This can look like (not tested):

class JqPlot extends Widget {
  // Used to generate unique ID
  private static int count = 0;

  public JqPlot() {
setElement(Document.get().createDivElement());
// Add a unique id to your div
getElement().setId(__jsplot__gwt__ + count++);
  }

  @Override
  public void onLoad() {
// Now the div is attached to the DOM, jqPlot will find it
createGraph(getElement().getId());
  }

  private native void createGraph(String id) /*-{
...
$.jsPlot(id, );
  }-*/;
}

But you need many more work. You need to handle multiple call to
onLoad. You need also to wrap all arguments needed by jsPlot and cache
them into your Widget until you create the chart...

You problem is not jqPlot and MVP, it's just jqPlot and GWT.

Olivier

On 9 juin, 15:55, Rizen vianney.dep...@gmail.com wrote:
 I want to cast a JavaScriptObject to an Element cause I think is the
 best solution for the moment. Using the MVP architecture I don't know
 how to do that in a different way. If there is something better I will
 be interested as well.

 About the problem with $, I wrote typeof($) in FireBug's console. It
 return function. So I think it's ok for the include, I've tried via
 the .html and the xml configuration.

 Thank you very much for your help until now.

-- 
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: ClickHandler not called on second click

2010-06-02 Thread Olivier Monaco
Danny,

What your click handler does? May be it puts some (transparent)
element in front of the button... How do you use the PushButton? What
is the exact structure of panels? You need to build a test case to us
help you.

Olivier

On 2 juin, 08:02, Danny Goovaerts danny.goovae...@gmail.com wrote:
 I have not yet been able to isolate the code while reproducing the
 problem. It's probably related to the actual structured of the page.
 But I managed to get some more information using the debugger.

 - The problem occurs when using a PushButton (constructed using the
 constructor PushButton(Image image)), not when using a simple Button
 - In the class CustomButton when the method onBrowserEvent is called
 for a MOUSUP event :
 ...
 case Event.ONMOUSEUP:
         if (isCapturing)
           isCapturing = false;
           DOM.releaseCapture(getElement());
           if (isHovering()  event.getButton() == Event.BUTTON_LEFT)
 {
             onClick();
           }
         }
         break;
 ...

 isHovering() returns true at the first click while it returns false at
 the subsequent clicks

 The method isHovering is implemented as follows

 final boolean isHovering() {
     return (HOVERING_ATTRIBUTE  getCurrentFace().getFaceID())  0;
   }

 At the first click getCurrentFace().getFaceID()) evaluates to 3, while
 at the subsequent clicks, it evaluates to 1.
 So there is probably something wrong in setting the correct face in
 the particular situation.

 I hope that this can provide enough information to find the real root
 cause.

 Danny

 On Jun 1, 6:21 pm, Danny Goovaerts danny.goovae...@gmail.com wrote:

  My application is quite large. The button is several levels deep,
  i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy
  of divs. I will try to isolate while still reproducing the error.
  I would also try to step through the code in a debugger, but
  unfortunaly for this I need to move the mouse from the page to
  Eclipse, which prevents from reproducing the error.
  Danny

  On Jun 1, 4:17 pm, Ranjan ranjan.n...@gmail.com wrote:

   Something like that should not have gone unnoticed for so long. Could
   you post your code snippet?

   On Jun 1, 12:07 pm, Olivier Monaco olivier.mon...@free.fr wrote:

Danny,

I had no problem (in dev mode). Here is my test case:

    public void onModuleLoad()
    {
        Button b = new Button(click me);
        b.addClickHandler(new ClickHandler()
        {
            @Override
            public void onClick(ClickEvent event)
            {
                RootPanel.get().add(new Label(clicked));
            }
        });
        RootPanel.get().add(b);
    }

What's your test case?

Olivier

On 1 juin, 08:07, Danny Goovaerts danny.goovae...@gmail.com wrote:

 I have a button with a ClickHandler. When I move the mouse over the
 button and click the button, the ClickHandler is called. When I do no
 move the mouse away from the button, the ClickHandler is not called on
 any subsequent clicks. I have to move the mouse away from the button
 and back. Then the ClickHandler is called when I click again.

 To investigate, I have added a MouseDownHandler and a MouseUpHandler.
 These are called on subsequent clicks, only the ClickHandler is not
 called.
 As the focus stays on the button, I have tried hitting the enter key.
 This triggers calling the ClickHandler.

 I 've tried adding a DeferredCommand to the ClickHandler with a
 variaty of actions(remove focus, remove focus and set focus again),
 but this does not change anything.

 Environment
 - GWT 2.0.3
 - Vista
 - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0

 There are several posts in this forum that describe a similar
 behaviour 
 (e.g.http://groups.google.com/group/google-web-toolkit/browse_thread/threa...)
 but none have a solution.

 Any idea how to solve this?

 Thanks in advance,

 Danny

-- 
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: ClickHandler not called on second click

2010-06-01 Thread Olivier Monaco
Danny,

I had no problem (in dev mode). Here is my test case:

public void onModuleLoad()
{
Button b = new Button(click me);
b.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
RootPanel.get().add(new Label(clicked));
}
});
RootPanel.get().add(b);
}

What's your test case?

Olivier

On 1 juin, 08:07, Danny Goovaerts danny.goovae...@gmail.com wrote:
 I have a button with a ClickHandler. When I move the mouse over the
 button and click the button, the ClickHandler is called. When I do no
 move the mouse away from the button, the ClickHandler is not called on
 any subsequent clicks. I have to move the mouse away from the button
 and back. Then the ClickHandler is called when I click again.

 To investigate, I have added a MouseDownHandler and a MouseUpHandler.
 These are called on subsequent clicks, only the ClickHandler is not
 called.
 As the focus stays on the button, I have tried hitting the enter key.
 This triggers calling the ClickHandler.

 I 've tried adding a DeferredCommand to the ClickHandler with a
 variaty of actions(remove focus, remove focus and set focus again),
 but this does not change anything.

 Environment
 - GWT 2.0.3
 - Vista
 - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0

 There are several posts in this forum that describe a similar
 behaviour 
 (e.g.http://groups.google.com/group/google-web-toolkit/browse_thread/threa...)
 but none have a solution.

 Any idea how to solve this?

 Thanks in advance,

 Danny

-- 
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: Calling Methode using JSNI failed

2010-06-01 Thread Olivier Monaco
And autoboxing does not works in JSNI.

   th...@de.test.designer::sendNode(Ljava/lang/String;Ljava/lang/
Integer)(TEST,@java.lang.Integer::new(I)(100));

Or change your sendNode method to take an int.

Olivier

On 1 juin, 04:25, Jim Douglas jdoug...@basis.com wrote:
 You should start by carefully reading the JSNI documentation:

 http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI...http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-g...

 A simple JSNI method looks like this (note the specially formatted
 braces, which Java sees as a comment block, and therefore ignores):

 public static native void alert(String msg) /*-{
   $wnd.alert(msg);

 }-*/;

 On May 31, 3:25 pm, malibubu webmas...@mailball.de wrote:

  Sorry, this was a typo.

  I also tried the signature

    th...@de.test.designer::sendNode(Ljava/lang/String;I)(TEST,100);

  with methode sendNode(String id, int x)

  Same problem :(

  On 31 Mai, 23:48, kozura koz...@gmail.com wrote:

   Maybe try with int x and use I instead of the Integer class.  Also
   even as is, your Integer method signature isn't quite right: land-

   lang.

   On May 31, 3:15 pm, malibubu webmas...@mailball.de wrote:

Hi,

I've the following class:

package de.test;
public class Designer {

public native void addNode() {
   alert(Pre JSNI);
   th...@de.test.designer::sendNode(Ljava/lang/String;Ljava/land/
Integer)(TEST,100);
   alert(Post JSNI);

}

void sendNode(String id, Integer x) {
   GWT.log(It Works!);

}
}

If addNode() is called, the first Alert is shown. Then, the following
JS-Error occurs (IE8):

Details zum Fehler auf der Webseite
Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0)
Zeitstempel: Mon, 31 May 2010 21:15:12 UTC
Meldung: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.
Zeile: 11460
Zeichen: 7
Code: 0
URI:http://localhost:8080/test/test/DDB7CB660FDE7BAFEE5000321CF27CD1.cach...

Any ideas what I'm doing wrong?

Thank you!- Zitierten Text ausblenden -

   - Zitierten Text anzeigen -

-- 
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: How to achieve traditional website behavior with layout panels?

2010-05-28 Thread Olivier Monaco
You must not use *LayoutPanel for this purpose. Why not native HTML?

MyApp.ui.xml
!DOCTYPE ui:UiBinder SYSTEM http://dl.google.com/gwt/DTD/xhtml.ent;
ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder
xmlns:g='urn:import:com.google.gwt.user.client.ui'
  ui:style
.top {
  height: 120px;
}
  /ui:style
  HTMLPanel
div class={style.top}
  g:Button ui:field=buttonClick me/g:Button
/div
g:FlowPanel ui:field=content /
  /HTMLPanel
/ui:UiBinder


MyApp.java
public class MyApp extends Composite {
  ... // UiBinder stuff

  public MyApp() {
initWidget(binder.createAndBind(this));
  }

  @UiHandler(button)
  void onButtonClick(ClickEvent event) {
content.add(new Label(Hello world);
  }
}


Not tested...

Olivier
On 28 mai, 10:39, googelybear googelyb...@gmail.com wrote:
 @Stefan: I know the term sucks, but it was the best I could come up
 with ;-) As you concluded my main goal is to have browser scrollbar
 scrolling and not the inner scrolling (lots of individual scrollbars
 inside the containers itself, an example for this is google wave).

 So in your words (...) you have to allow the parents to grow with its
 child.   That's exactly the behavior of the old panels. I'm not
 really clear on how we could emulate this on the new panels (all my
 attempts so far failed).

 To make a simple example: I have a DockLayoutPanel and somewhere a
 button. There is a FlowPanel in the center. Clicking on that button
 adds a label to the center panel. Repeatedly clicking that button
 fills the center panel and at some point additional labels are not
 displayed anymore (simulates the dynamic content). This is as you
 wrote because of the overflow:hidden/auto which is set on the
 DockPanel - in the LayoutPanels in general - (and is IMPOSSIBLE to
 override by the programmer - at least I didn't succeed). If I add a
 scrollPanel to the center as parent of the FlowPanel I get said inner
 scrolling But what I would like to have is that the DockLayoutPanel
 itself grows (vertically) which forces the browser to display
 scrollbars.

 I uploaded the (very simple) demo project here (Just import in eclipse
 and run):http://drop.io/gwt_dock_panel

 It would be really great if you could share how to achieve the
 behavior described above.

 thanks,
 Dennis

 On May 27, 6:55 pm, Stefan Bachert stefanbach...@yahoo.de wrote:

  Hi Dennis,

  I still think what traditionalbehaviour should be. (? not following
  the standards?)

  However, you don't want scrollbars at your LayoutPanel.

  The reason why any widget gets a scrollbar is because it is larger
  than its parent and the style overflow is set to auto or scroll.
  When the wrong widget get a scrollbar you have to change the size of
  the panel (div) hierarchy.
  Or you have to allow the parents to grow with its child.

  When you do not succeed you need to show us your code or at least the
  hierarchy ofpanels.

  Stefan Bacherthttp://gwtworld.de

  On 26 Mai, 10:33, googelybear googelyb...@gmail.com wrote:

   Hi,

   I am developing a webapp that should behave like atraditionalweb
   page, meaning that when the content grows in height the browser should
   display a vertical scroll bar. Unfortunately I was foolish and jumped
   right in on the new, shinylayoutpanels. As I found out later these
   are not suitable for me, as they create a more application-like look
   and feel with scrollbars displayed in the individual gwtpanels
   instead of the browser (try resizing e.g. google wave - When the
   available area is too small scrollbars will appear inside all the
  panels, the browser will never display any scrollbars) and also they
   are working with lots of fixed sizes (in my case the content is
   dynamic).
   I tried toachievethetraditionalbehaviorwith my LayoutPanels but
   failed. I couldn't get the browser to display scrollbars, only inner-
   panel scrolling, and stuffing a layoutpanel inside a scrollpanel is
   not the desirable approach (stuffinglayoutpanelsinside non-layout
  panelsusually ended badly for me..).
   So my conclusion is to revert to the old schoolpanels. But I am
   afraid that support of these will be dropped soon. What do you think?
   Are there better alternatives? Anyone fought with a similar problem?

   thanks for any suggestions,
   Dennis



-- 
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: How to add an Element object into a Widget.

2010-05-28 Thread Olivier Monaco
Replace Composite by Widget and initWidget by setElement...

You can also you GWT tables...

Olivier

On 28 mai, 13:08, Rizen vianney.dep...@gmail.com wrote:
 Hello,

 For my project, I would like to create a table in HTML by means of the
 DOM tree.
 For this, I'm just using the functions DOM.createTable(),
 DOM.createTBody(), DOM.createTR()...
 However the generated table is an Element type.

 Except that I'm using the MVP as a pattern for my application. So I
 have to init the main Widget with the function initWidget(), which
 takes a Widget object as parameter. I was looking for a panel like the
 HTMLPanel but no method can change or add an Element into a Widget.

 Is there a method that I can use to cast the Element object in Widget
 object ?

 Here is an example of code :

 public class View extends Composite {

         public View() {
                 Element table = DOM.createTable();
                 Element tbody = DOM.createTBody();
                 Element tr = DOM.createTR();
                 Element td = DOM.createTD();

                 tr.appendChild(td);
                 tbody.appendChild(tr);
                 table.appendChild(tbody);

                 // Need a Widget as a type
                 initWidget(table);
         }

 }



-- 
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: Synchronous Calls with RPC??

2010-05-28 Thread Olivier Monaco
Carl,

Your proposal is interesting. But as a user, if I have to wait, I
leave... So many be an application needing some wait a minute popup
is not a good approach for the future. Imagine your browser putting a
popup each time a page is loading. Tabs will become useless, multi-
core computer too and so one...

Okay, it's not easy to do such application without popups. And I'm the
first to use popup ;). But it can be really, really better.

Olivier

On 28 mai, 06:36, Carl Pritchett bogusggem...@gmail.com wrote:
 I'm on the synchronous calls are the wrong approach side, but what
 would really be useful would be some utility classes that allowed
 synchronous like approaches.

 Specifically :
 - an async batcher that given a list of async services calls all at
 once and then executes a specified action when all return (it keeps an
 internal count of async calls returned)
 - a serialized async batcher that calls a list of async services one
 at a time and then executes a specified action when the last one
 returns (each callback triggers the next async call)

 So you could block all (or part) of the UI with a modal overlay, call
 the async batcher and set the return action to fire an event to
 unblock the UI.

 I found this pattern helpful when loading data from different services
 while making the user wait till all the data has arrived. It can be a
 bit more flexible that building lots of services (and the returned
 objects) into one call.

 Regards,
 Carl

-- 
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: How to achieve traditional website behavior with layout panels?

2010-05-27 Thread Olivier Monaco
I use both. My goal is to be IE8+ compliant, so many problems go away.
Then, for others, I use GWT to avoid writing CSS hacks.

Be aware that Panels are for Quirks Mode and Layout are for Compliant/
Standard Mode. In the first mode, browser have many differences, which
Panels try to correct. In the second mode, there are, for recent
browser, less differences. I always write my pages as XHTML (strict if
possible) so I don't need many GWT complex component.

Finally, for website, I never use Panels like Stack, Dock... because
its not for website, it's for app. That the reason there must be
replaced by there Layout counterparts.

Olivier

On 27 mai, 09:51, googelybear googelyb...@gmail.com wrote:
 I also prefer to do the styling with CSS and not via gwt methods. But
 I still use the panels as one of the strengths of gwt is that it knows
 best how to create them in a cross-platform/ cross-browser way and
 deals with the browser differences for me (at least in theory). I then
 just style them with CSS to look the way I want.
 If I would implement everything with html tags I would have to deal
 with browser differences again and start implementing browser hacks
 which I want to avoid at all cost. What do  you think?

 Dennis

 On May 26, 10:06 pm, Olivier Monaco olivier.mon...@free.fr wrote:

  When I want to create a website like app, I use as many HTML tags as
  possible with UiBinder. Then, I use CSS to sets the position, border,
  color... and never the GWT methods. That way, I have a true web site
  but using GWT. I don't like to create a website-like app (something
  that looks like a web site but with widgets like in app): you want a
  website (HTML + CSS) or an app (Widgets + Layout).

  Olivier

  On 26 mai, 13:53, googelybear googelyb...@gmail.com wrote:

   Are you not afraid that they will get removed soon?
   I always get deprecated warnings when using them: StackPanel is
   deprecated. Use the StackLayoutPanel instead. and same for others
   (DockPanel, TabPanel, ...).

   What's the official policy on this?

   On May 26, 11:49 am, Olivier Monaco olivier.mon...@free.fr wrote:

For a traditionnallayout, I use the old schoolpanels. It's not
really a old school, it just has another goal.

Olivier

On 26 mai, 10:33, googelybear googelyb...@gmail.com wrote:

 Hi,

 I am developing a webapp that should behave like atraditionalweb
 page, meaning that when the content grows in height the browser should
 display a vertical scroll bar. Unfortunately I was foolish and jumped
 right in on the new, shinylayoutpanels. As I found out later these
 are not suitable for me, as they create a more application-like look
 and feel with scrollbars displayed in the individual gwtpanels
 instead of the browser (try resizing e.g. google wave - When the
 available area is too small scrollbars will appear inside all the
panels, the browser will never display any scrollbars) and also they
 are working with lots of fixed sizes (in my case the content is
 dynamic).
 I tried toachievethetraditionalbehaviorwith my LayoutPanels but
 failed. I couldn't get the browser to display scrollbars, only inner-
 panel scrolling, and stuffing a layoutpanel inside a scrollpanel is
 not the desirable approach (stuffinglayoutpanelsinside non-layout
panelsusually ended badly for me..).
 So my conclusion is to revert to the old schoolpanels. But I am
 afraid that support of these will be dropped soon. What do you think?
 Are there better alternatives? Anyone fought with a similar problem?

 thanks for any suggestions,
 Dennis



-- 
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: UIObject getOffsetWidth() method returning absurd value for IE

2010-05-27 Thread Olivier Monaco
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/Widget.html#isAttached()

On 27 mai, 08:00, Tapas Adhikary tapas4...@gmail.com wrote:
 Hi mmoossen,
 Thanks for the reply. If u can explain it little more , it will be  a great
 help. I didn't get this part of your mail ,

  our widget is attached to the doc when calling that method, *AND*
  that it is also visible!

 What do I need to check exactly ?

 Thanks,
 -tapas

 On Tue, May 25, 2010 at 5:43 PM, mmoossen mmoos...@gmail.com wrote:
  Hi tapas!

  that is most likely a timing issue. what i mean is that you have to
  check that:
  - your widget is attached to the doc when calling that method, *AND*
  - that it is also visible!

  HTH
  Michael

  On May 25, 7:09 am, Tapas Adhikary tapas4...@gmail.com wrote:
   Hi all,,

   Can anybody give any clue on this ?

   On Mon, May 24, 2010 at 1:05 PM, Tapas Adhikary tapas4...@gmail.com
  wrote:
I am using GWT 2.0 . In my application , I am using a logic to
randomly/correctly position the pop-up when I click an anchor link. I
  am
setting the position of the popup using the UiObject's OffsetWidth and
OffsetHeight property.

I am calling ,

popupPanel.setPopupPositionAndShow( new PopupPanel.PositionCallback()
{
public void setPosition(
 int iOffsetWidth,
int iOffsetHeight)
 {
                               // Some code
                        }
               }
The position callback happens from the PopupPanel.java which in turn
  gets
the offsetHeight and offset width from the UIObject's
 public int getOffsetWidth() {
    return DOM.getElementPropertyInt(getElement(), offsetWidth);
  }

The problem happens when I click on one specific anchor link. The
  pop-up
width is returned correctly in mozilla but in IE it gives me a huge
value(only for this anchor link, for all the other anchors it gives
  back the
proper width).

Is the width of the anchor responsible for this as it only happening
  for a
particular link and on IE?
Is it a kind of known issue that I am not aware of ?

Thanks in advance.

-Tapas

   --
   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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
   For more options, visit this group athttp://
  groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



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



GWT 2.1m1/DateTimeFormat - format for full time has changed

2010-05-27 Thread Olivier Monaco
Hi,

Some of my unit test failed after switching to GWT 2.1m1. This is due
to the following change:
http://code.google.com/p/google-web-toolkit/source/diff?spec=svn8214r=7629format=sidepath=/trunk/user/src/com/google/gwt/i18n/client/constants/DateTimeConstantsImpl.propertiesold_path=/trunk/user/src/com/google/gwt/i18n/client/constants/DateTimeConstantsImpl.propertiesold=4905

The full format for time has changed from h:mm:ss a v to h:mm:ss
a . The first give me 1:00:00 AM Etc/GMT-1 but the second
1:00:00 AM UTC+1, so the same as the long format.

Is it a regression? or was there a bug before?

Olivier

-- 
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: Is there a way to wait a RequestBuilder action finished and then do next RequstBuilder action?

2010-05-27 Thread Olivier Monaco
When the first request ends, the onSuccess method of the
RequestCallback is called. Send the second request from here. Example:

public void phase1() {
  // first request
  RequestBuilder b = ...;
  ...
  b.setCallback(new RequestCallback() {
public void onSuccess(...) {
  phase2();
}
  });
  ...
}

public void phase2()
{
  // second request
  ...
}

On 27 mai, 09:31, recoco recoco.zh...@gmail.com wrote:
 I'm using writing a login process from a remote server with GWT. The
 process is that client get a token first and then use this token and
 username to login in the server. So I wrote two methods. One is
 getToken , another is postLogin. Both use RequestBuider to communate
 to the remote server and should be executed orderly. But I found that
 POST action which is postLogin always execute before getLogin. The
 postLogin method will fail because the token is still not returned
 from the server.
 So, how to wait the first action finished and the perform the second
 one? Thanks in advance.

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



Re: GWT 2.1m1/DateTimeFormat - format for full time has changed

2010-05-27 Thread Olivier Monaco
Okay, make sense.

Thanks.

On 27 mai, 18:11, Thomas Broyer t.bro...@gmail.com wrote:
 On 27 mai, 16:02, Olivier Monaco olivier.mon...@free.fr wrote:

  Hi,

  Some of my unit test failed after switching to GWT 2.1m1. This is due
  to the following 
  change:http://code.google.com/p/google-web-toolkit/source/diff?spec=svn8214;...

  The full format for time has changed from h:mm:ss a v to h:mm:ss
  a . The first give me 1:00:00 AM Etc/GMT-1 but the second
  1:00:00 AM UTC+1, so the same as the long format.

  Is it a regression? or was there a bug before?

 I suspect locale data has been updated to the latest Unicode CLDR
 data.http://cldr.unicode.org/

-- 
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: Limit generator invocation count

2010-05-26 Thread Olivier Monaco
Matt,

You generator is called for each permutation but it may not generate
the same code each time. You generator must include the following
code:

PrintWriter printer = context.tryCreate(logger, packageName,
className);
if (printer != null) {
// Create a ClassSourceFileComposerFactory and generate
the code
}

The context.tryCreate method returns a PrintWriter if the class named
packageName.className does not exists, null otherwise. The first
call to your generator creates the class, the subsequents not. Better,
if the class already exists before the compilation (ie. you created
that class by hand), your generator don't create it.

Olivier

On 26 mai, 08:48, Matt mydevmailingli...@gmail.com wrote:
 Hi,

 I've written a custom generator, which functionally works fine. The
 only slightly nagging point is that the generator generates the same
 source code for all permutations, but still gets invoked once per
 permutation (which means quite a few times for an app with i18n...).
 This increases build time - is there any way to only invoke the
 generator once, or to somehow cache the generated code so speed things
 up?

 Thanks for any help,
 Matt

-- 
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: Data exchange between two applications

2010-05-26 Thread Olivier Monaco
I will create a 3 GWT modules:
- app A
- app B
- app A and B

You will have the best optimization. If you add the 2 modules
separately, you will have code duplication (code for the String class
in app A and code for the same class in app B).

Olivier

On 26 mai, 11:20, Stefan Ludwig tapir0...@gmail.com wrote:
 Hi,

 I have to exchange datas between two GWT apps.

 Current situation:
 Application 1 is a stock symbol search (e.g. IBM or GOOG for
 Google) which shows the symbol results in a list.

 Application 2 is a stock quote application. The user has just to enter
 a symbol and he will see the current quote.

 What I have to do:
 A page with two divs. Div A contains app 1, div B contains app 2. Now
 I have to concatenate these two apps. Means, when a user clicks on a
 symbol in the result list of the search app, the quote for these
 symbol has to be shown in the app 2.
 But - both of these two apps also has to works as standalone
 applications.

 Any ideas what I have to do..?

 Thanks and regards
 Steff

-- 
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: How to achieve traditional website behavior with layout panels?

2010-05-26 Thread Olivier Monaco
For a traditionnal layout, I use the old school panels. It's not
really a old school, it just has another goal.

Olivier

On 26 mai, 10:33, googelybear googelyb...@gmail.com wrote:
 Hi,

 I am developing a webapp that should behave like a traditional web
 page, meaning that when the content grows in height the browser should
 display a vertical scroll bar. Unfortunately I was foolish and jumped
 right in on the new, shiny layout panels. As I found out later these
 are not suitable for me, as they create a more application-like look
 and feel with scrollbars displayed in the individual gwt panels
 instead of the browser (try resizing e.g. google wave - When the
 available area is too small scrollbars will appear inside all the
 panels, the browser will never display any scrollbars) and also they
 are working with lots of fixed sizes (in my case the content is
 dynamic).
 I tried to achieve the traditional behavior with my LayoutPanels but
 failed. I couldn't get the browser to display scrollbars, only inner-
 panel scrolling, and stuffing a layoutpanel inside a scrollpanel is
 not the desirable approach (stuffing layout panels inside non-layout
 panels usually ended badly for me..).
 So my conclusion is to revert to the old school panels. But I am
 afraid that support of these will be dropped soon. What do you think?
 Are there better alternatives? Anyone fought with a similar problem?

 thanks for any suggestions,
 Dennis

-- 
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: How to achieve traditional website behavior with layout panels?

2010-05-26 Thread Olivier Monaco
When I want to create a website like app, I use as many HTML tags as
possible with UiBinder. Then, I use CSS to sets the position, border,
color... and never the GWT methods. That way, I have a true web site
but using GWT. I don't like to create a website-like app (something
that looks like a web site but with widgets like in app): you want a
website (HTML + CSS) or an app (Widgets + Layout).

Olivier

On 26 mai, 13:53, googelybear googelyb...@gmail.com wrote:
 Are you not afraid that they will get removed soon?
 I always get deprecated warnings when using them: StackPanel is
 deprecated. Use the StackLayoutPanel instead. and same for others
 (DockPanel, TabPanel, ...).

 What's the official policy on this?

 On May 26, 11:49 am, Olivier Monaco olivier.mon...@free.fr wrote:

  For a traditionnallayout, I use the old schoolpanels. It's not
  really a old school, it just has another goal.

  Olivier

  On 26 mai, 10:33, googelybear googelyb...@gmail.com wrote:

   Hi,

   I am developing a webapp that should behave like atraditionalweb
   page, meaning that when the content grows in height the browser should
   display a vertical scroll bar. Unfortunately I was foolish and jumped
   right in on the new, shinylayoutpanels. As I found out later these
   are not suitable for me, as they create a more application-like look
   and feel with scrollbars displayed in the individual gwtpanels
   instead of the browser (try resizing e.g. google wave - When the
   available area is too small scrollbars will appear inside all the
  panels, the browser will never display any scrollbars) and also they
   are working with lots of fixed sizes (in my case the content is
   dynamic).
   I tried toachievethetraditionalbehaviorwith my LayoutPanels but
   failed. I couldn't get the browser to display scrollbars, only inner-
   panel scrolling, and stuffing a layoutpanel inside a scrollpanel is
   not the desirable approach (stuffinglayoutpanelsinside non-layout
  panelsusually ended badly for me..).
   So my conclusion is to revert to the old schoolpanels. But I am
   afraid that support of these will be dropped soon. What do you think?
   Are there better alternatives? Anyone fought with a similar problem?

   thanks for any suggestions,
   Dennis

-- 
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: Synchronous Calls with RPC??

2010-05-17 Thread Olivier Monaco
Ok, I see what you mean. I'm not sure about adding this feature but
maybe a better documentation about the bad idea of

On 17 mai, 08:37, mmoossen mmoos...@gmail.com wrote:
 i completely agree with you Oliver!

 i said already that i think that sync-rpc is a really bad idea in this
 case. which was already addressed in detail by you and others.

 my point was against the spirit of the gwt team to do not give the
 developer the choice to use sync requests if he wants to.
 it is like never letting a child to cross the street alone instead of
 teaching him to watch out.

 what we need is better developers and the way to achieve that is to do
 mistakes and be willing to learn, and not a tool that tells you i do
 not allow you to do that because it *might* be a bad idea...

 regards,
 Michael

 On May 16, 9:39 pm, Olivier Monaco olivier.mon...@free.fr wrote:



  Michael,

  I'm totally disagreed with you. When you choose to answer here, you
  choose to give a good one. When you know someone is going the wrong
  way, don't let him going to far. Fighting against problems is not a
  good way to learn, you also need to have references.

  Please, read again the 
  following:http://www.catb.org/~esr/faqs/smart-questions.html#id383614

  If you're going to answer the question at all, give good value. Don't
  suggest kludgy workarounds when somebody is using the wrong tool or
  approach. Suggest good tools. Reframe the question.

  Regards,

  Olivier

  On 16 mai, 08:39, mmoossen mmoos...@gmail.com wrote:

   Hi,

   Despite that i wrote the patch for sync-rpc, I completely agree with
   kozura that in this case sync-rpc would be a bad idea.
   BUT, who cares? if fomba wants to use it, it is up to him, if his
   application is not responsive it is his problem not mine.
   (this reminds me the apple-adobe 
   conflict:http://sixrevisions.com/web-development/issues-with-apples-decision-t...,
   2nd point)

   HTH
   Michael

   --
   You received this message because you are subscribed to the Google Groups 
   Google Web Toolkit group.
   To post to this group, send email to google-web-tool...@googlegroups.com.
   To unsubscribe from this group, send email to 
   google-web-toolkit+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Synchronous Calls with RPC??

2010-05-17 Thread Olivier Monaco
(Sorry, my message was incomplete)

Ok, I see what you mean. I'm not sure about adding this feature but
maybe a better documentation about the bad idea of using sync
request.

Olivier

On 17 mai, 08:37, mmoossen mmoos...@gmail.com wrote:
 i completely agree with you Oliver!

 i said already that i think that sync-rpc is a really bad idea in this
 case. which was already addressed in detail by you and others.

 my point was against the spirit of the gwt team to do not give the
 developer the choice to use sync requests if he wants to.
 it is like never letting a child to cross the street alone instead of
 teaching him to watch out.

 what we need is better developers and the way to achieve that is to do
 mistakes and be willing to learn, and not a tool that tells you i do
 not allow you to do that because it *might* be a bad idea...

 regards,
 Michael

 On May 16, 9:39 pm, Olivier Monaco olivier.mon...@free.fr wrote:



  Michael,

  I'm totally disagreed with you. When you choose to answer here, you
  choose to give a good one. When you know someone is going the wrong
  way, don't let him going to far. Fighting against problems is not a
  good way to learn, you also need to have references.

  Please, read again the 
  following:http://www.catb.org/~esr/faqs/smart-questions.html#id383614

  If you're going to answer the question at all, give good value. Don't
  suggest kludgy workarounds when somebody is using the wrong tool or
  approach. Suggest good tools. Reframe the question.

  Regards,

  Olivier

  On 16 mai, 08:39, mmoossen mmoos...@gmail.com wrote:

   Hi,

   Despite that i wrote the patch for sync-rpc, I completely agree with
   kozura that in this case sync-rpc would be a bad idea.
   BUT, who cares? if fomba wants to use it, it is up to him, if his
   application is not responsive it is his problem not mine.
   (this reminds me the apple-adobe 
   conflict:http://sixrevisions.com/web-development/issues-with-apples-decision-t...,
   2nd point)

   HTH
   Michael

   --
   You received this message because you are subscribed to the Google Groups 
   Google Web Toolkit group.
   To post to this group, send email to google-web-tool...@googlegroups.com.
   To unsubscribe from this group, send email to 
   google-web-toolkit+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Classname table in generated JS

2010-05-17 Thread Olivier Monaco
Hi,

Maybe it's about this : 
http://code.google.com/p/google-web-toolkit/wiki/NoClassMetadataOptimization

Olivier

On 17 mai, 12:18, mmoossen mmoos...@gmail.com wrote:
 Dear all!

 i just found this:http://degwt.googlecode.com

 and i was really surprised to actually find a classname table in the
 generated production js code.

 i know that the rpc classes and methods are used (which i do not like
 very much, but that is another story).

 but i do not see any need for a general classname table, i mean every
 single class even enums are listed there.
 additionally there seems to be also a kind of lookup table for style
 names!!?

 could somebody please explain to me why this is needed?

 i mean all this data is taking about 180Kb of 500Kb of my production
 cache files, and i would really like to know what is the idea behind
 that...

 Thanks
 Michael

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Synchronous Calls with RPC??

2010-05-16 Thread Olivier Monaco
Michael,

I'm totally disagreed with you. When you choose to answer here, you
choose to give a good one. When you know someone is going the wrong
way, don't let him going to far. Fighting against problems is not a
good way to learn, you also need to have references.

Please, read again the following: 
http://www.catb.org/~esr/faqs/smart-questions.html#id383614

If you're going to answer the question at all, give good value. Don't
suggest kludgy workarounds when somebody is using the wrong tool or
approach. Suggest good tools. Reframe the question.

Regards,

Olivier

On 16 mai, 08:39, mmoossen mmoos...@gmail.com wrote:
 Hi,

 Despite that i wrote the patch for sync-rpc, I completely agree with
 kozura that in this case sync-rpc would be a bad idea.
 BUT, who cares? if fomba wants to use it, it is up to him, if his
 application is not responsive it is his problem not mine.
 (this reminds me the apple-adobe 
 conflict:http://sixrevisions.com/web-development/issues-with-apples-decision-t...,
 2nd point)

 HTH
 Michael

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Development mode problem: Keep asking to install plugin

2010-05-15 Thread Olivier Monaco
Vj,

This question is like what gaz to put in my car... which browser do
you use?

I had a similar issue with Firefox 3 under Debian Lenny (Linux). The
problem comes from the firefox profile. I've done some manual cleaning
(I don't remember what) and that worked. Maybe your problem...

Olivier

On 13 mai, 05:43, VJ vijay.pah...@gmail.com wrote:
 Hi, I am new the GWT and created a sample application (eclipse
 Galileo).  When I run the application in Development Mode, it asks me
 to install the plug-in.  After successful installation, 'Please enter
 your name' flashes and it goes back to install the plug-in.
 Any help is appreciated.
 Thanks,
 -VJ.

 --
 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 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: GWT.isClient() always return true

2010-05-15 Thread Olivier Monaco
Hi,

Great programmers write docs, like JavaDoc. Please respect their work
by reading it.

http://www.catb.org/~esr/faqs/smart-questions.html#before

Olivier

On 15 mai, 15:53, fonghuangyee fonghuang...@gmail.com wrote:
 Hi,

 I dun know why GWT.isClient() always return true even in web mode.
 Please advise, thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: What is the use of gwt-api-checker.jar in GWT 2.0.3

2010-05-14 Thread Olivier Monaco
Charan,

Of course, you search through manual (http://code.google.com/intl/fr/
webtoolkit/overview.html) without success. But did you search through
the Wiki of the Googlecode project (http://code.google.com/p/google-
web-toolkit/)?

Olivier

On 14 mai, 11:36, Charan s.chara...@gmail.com wrote:
 Hi,

 I was developing a GWT app in 2.0.3 version.
 I have seen two files newly added gwt-api-checker.jar and gwt-soyc-
 vis.jar
 i never used any of these jars files in my app development.
 Anyone can tell me what is purpose of these jars files.

 Regards
 Charan

 --
 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 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: Synchronous Calls with RPC??

2010-05-14 Thread Olivier Monaco
Hi,

Doing synchronous call is globally a bad idea. What is your exact
need?

Olivier

On 14 mai, 17:05, fomba collins fomba_coll...@yahoo.com wrote:
 Hi, Is there a way of making synchronous calls in GWT using RPC. I actually 
 need something on the client side to ensure that the asynchronous processing 
 in rpc is complete. Can Anyone help?   

 --
 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 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: GWT article 'Large scale ...' license of source code

2010-05-14 Thread Olivier Monaco
Jan,

Please read the terms of use from the gwt web site. All is there.

Olivier

On 14 mai, 07:36, Jan Ehrhardt jan.ehrha...@googlemail.com wrote:
 Hello,

 I would like to reuse the source code of the GWT article 'Large scale
 application development and MVP' for my own samples and articles, but there
 is no license information provided with it. It would be great, if it would
 be provided under an open source license, e. g. Apache License 2.0 or even
 GPL v3 or AGPL.

 It would be great, if it were available in a Mercurial repository on Google
 Code, so it could be cloned by me.

 Regards
 Jan Ehrhardt

 --
 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 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

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



Re: FYI: A Simple GWT Generator Example

2010-04-12 Thread Olivier Monaco
Hi Francis,

Using your generator can lead to NPE: your getSourceWriter can returns
null (line 68).

A generator have two goals: returns the name of class to instantiate
and generate the code for that class. The first goal is mandatory, the
second not. If your generator returns the name of a class that already
exists, you don't have to generate the code. This can happen when the
implementation is hand written (like for replacement) or when your
generator is already call for the same type (same call to GWT.create
at different places). To know if the class already exist, check to
returned value of GeneratorContext.tryCreate. A null value indicates
that the class already exists.

Your getSourceWriter do the check and return null if that the case.
But you don't check the returned value of getSourceWriter... Next, you
can try to create the PrintWriter first (before creating the
ClassSourceFileComposerFactory) because you don't it the second if the
first is null...

Here is a better implementation:

@Override
public String generate(TreeLogger logger, GeneratorContext
context,
String typeName)
throws UnableToCompleteException
{
TypeOracle typeOracle = context.getTypeOracle();

// Find JClassType for this interface
JClassType intf = typeOracle.findType(typeName);
if (intf == null) {
logger.log(TreeLogger.ERROR, Class not found and it's
not
+  possible, oups.);
throw new UnableToCompleteException();
}
if (intf.isInterface() == null) {
logger.log(TreeLogger.ERROR, Not an interface.);
throw new UnableToCompleteException();
}

// Computer package name and class name for the resulting
implementation
String packageName = intf.getPackage().getName();
String className = intf.getSimpleSourceName() + _TikrayImpl;

// Create the printer
PrintWriter printer = context.tryCreate(logger, packageName,
className);

// If a printer is created, we must write the code
if (printer != null) {
ClassSourceFileComposerFactory composerFactory =
new ClassSourceFileComposerFactory(packageName,
className);
...
}

return packageName + . + className;
}

Olivier

On 10 avr, 01:56, Francis Shanahan francisshana...@gmail.com wrote:
 I had a lot of trouble getting a simple GWT Generator to work so
 here's an example, maybe this will help someone like me in future.

 http://francisshanahan.com/index.php/2010/a-simple-gwt-generator-exam...

 regards,
 -fs

-- 
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: Architectural ideas for a multi-app/module project

2010-04-08 Thread Olivier Monaco
Hi Jon,

As you see in the Inter-frame communication, we has the same
requierement.We choose the iframe solution to allow integration of
external applications.Yes, it's not the best way. Yes, there will be
some problem with the history. But we try many other solutions without
success. I think you need to compromise.

For example, for inter-frame communication we use postMessage. If the
browser doesn't support it, we use the window.name hack. This lead to
history issues. Bu we hope for a quick update of browsers: Windows 7
may quickly replace the old Windows XP, even for companies, replacing
any IE6/7 to IE8. Mozilla/Apple encourages the updates of Firefox/
Safari. Many web applications force updates to recent browsers (Google
Wave, Yahoo Mail). People wants more interactivity, more effects,
more... which need newer browser with supports for HTML5, SVG...

Hope we are in the true. ;)

Olivier

On 6 avr, 12:58, Jon Vaughan jsvaug...@gmail.com wrote:
 Hi all.

 I'm beginning to build a set of GWT applications for a client.

 The clients customers will purchase a set of these applications (not
 necessarily all of them) and when deployed these applications will
 work together (imagine, for example, a 'Contacts' app, a 'Billing'
 app, 'Timerecording' etc), linking back and forward between
 information in each.

 The client has a requirement that each app is independently
 deployable.  This would rule out the option of a monolithic compile
 despite its many advantages (optimization, memory footprint etc)

 - However they would also like the apps to all exist in a single
 window, to prevent confusion about pop-ups etc
 - And all of this has to work on relatively low powered machines and
 be IE6 compatible

 Possible options are iframes or a portal framework but in my view both
 of those are fairly horrible.  Iframes are going to mean history and
 inter app communication issues.  Portal frameworks mean an extra layer
 of effort, especially working out how to integrate the inter-portal
 communication with gwt.

 Alternatively I need to work out how to circumvent their independently
 deployable requirement.  Certainly there are enormous advantages to
 the single GWT compile.  The problem for the client is that if the UI
 has a common custom widget used in a couple of the apps, modifying it
 would mean retesting all apps that make use of it.  One solution to
 this I suppose is total codebase independence, with no common
 dependencies, or versioned widgets somehow, and I could argue for that
 style of approach.

 So I was wondering, does anyone have any alternative ideas, or
 thoughts about how they would approach the same situation

 Thanks

 Jon

-- 
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: Dynamic Module Loading

2010-03-31 Thread Olivier Monaco
Hi,

I don't know if I'll answer your question but we working on a main GWT-
module with pluggable sub-modules. Each sub-modules is an ui-
independant part of the whole application. To avoid interferences,
each module loads into its own iframe. I wrote a messaging system that
allow each module to communicate with each other (JSON serialization,
auto-discovery of other modules...).

Olivier

On 31 mar, 03:10, lineman78 linema...@gmail.com wrote:
 I know this is a common request of people trying to make pluggable
 applications.  It seems that every time someone comes up with a
 solution to this problem the GWT team changes the way the core linkers
 work and break the solution.  I was wondering if anyone knows a way to
 dynamically load a module either with a new linker, or a different
 method than the traditional appending a new script element to the end
 of the body.  I try to append a script element to the end of the body
 and it completely blows the document away and freezes the page in a
 loading mode.  I found an email exchange between members of the GWT
 contributors group in December where they discuss new methods for the
 default linkers using dynamic iframes.  I have been exploring this
 capability since 1.5 and every time I revisit it the method(hack job)
 I used the last time will not work.  I would really like a more
 consistent method.

 Every forum I have seen where someone asks this someone inevitably
 asks why, so let me head off this question by explaining.  I have run
 into this in a few different situations, one when trying to integrate
 GWT portlets into Liferay(Java portlet).  The second situation is in
 trying to create a dynamic binding of sorts.  I have been trying to
 figure out a way to create a GWT portal where you could install
 modules and they could be added and removed dynamically without having
 to recompile the core, creating something similar to iGoogle or
 Liferay in a GWT/J2EE implementation.

-- 
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: How can I access a window object in hand written java script in GWT

2010-03-24 Thread Olivier Monaco
This link may be a good start:
http://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html

Olivier

On 24 mar, 07:42, Muthu muthulala...@gmail.com wrote:
 Hi,

 I have a java script that I use from a third party. I needed to do
 some modification and as part of that I need to access the window
 object.

 Whenever I say window.something I get an error saying window is not
 defined. Any idea??

 Thanks,
 Muthu Shanmugam.

-- 
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: How can I change the body's background without using external style sheets?

2010-03-24 Thread Olivier Monaco
Hi,

Did you try something like:

Document.get().getBody().getStyle().setBackgroundColor(...);

Where Document is com.google.gwt.dom.client.Document.

Olivier

On 24 mar, 20:48, Shedokan shedok...@gmail.com wrote:
 How can I do in GWT this:
 document.body.style.background = red;

 I'm trying to change the background color of the body element without
 adding a special class to the body or any of that external css.

 Thanks.

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



Re: JavaScriptException during JSNI call: Invoking an instance method on a null instance

2010-03-23 Thread Olivier Monaco
Hi Thomas,

The problem with memory leaks in browser is that it's sometimes hard
to understand where they come from. Here, we are writting a little
piece of code that will be transformed (replacement of @...()) and
incorporated into a more complexe code. I don't want to look at the
generated code to check if leaks are possibile. So, I always use the
syntax I give so that I'm sure there will not be any leak... It's some
type of discipline.

Using a static method to inject the code seems to me being the same
thing...

Olivier

On 23 mar, 00:07, Thomas Broyer t.bro...@gmail.com wrote:
 On 22 mar, 23:42, Olivier Monaco olivier.mon...@free.fr wrote:





  The call method of a JavaScript function allows you to call it with
  a differente this. Then, using $wnd.js_callback.call(otherObject),
  the this variable reference otherObject. So the glue is:

  var that = this;
  $wnd.js_callback = function() {
      $entry(@mypackage.MyClass::MyMethod()).call(that);

  }

  When js_callback will be called, MyMethod is called on that, the
  JavaScript object representing the MyClass instance. Finally, to avoid
  memory leaks of closure:

  $wnd.js_callback = (function(obj) {
      return function() {
          $entry(@mypackage.MyClass::MyMethod()).call(obj);
      };

  })(this);

 ... or more simply:
 var that = this;
 $wnd.js_callback = $entry(function() { that.
 @mypackage.MyClass::MyMethod()(); });

 (this is what I should have written previously, sorry for the buggy
 code)

 As for the leak, are you sure there really is one once the code is
 translated into JS? would it be better if the inject method were a
 static one with the instance being passed as an argument (no use of
 the thiskeyword within JSNI)?

-- 
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: JavaScriptException during JSNI call: Invoking an instance method on a null instance

2010-03-23 Thread Olivier Monaco
ChrisK,

On 23 mar, 10:32, ChrisK cknow...@gmail.com wrote:
 Thomas - your solution worked from 6 worked but at first I didn't
 include both pairs of brackets after the function call MyMethod but
 it turns out they are required. With only one set (i.e. no arguments),
 it just doesn't work. I thought that was legal but maybe not.

Remember that @mypackage.MyClass::MyMethod() is a reference to the
function, not a call. The parenthesis allow you to give the full
signature of the method. Java allows two methods to have the same name
but different parameters. GWT needs the full signature to find which
method you want to reference, even is there is only one method with
this name.

The second parenthesis are to call the method. If you forgot then, you
just obtain the function object and do nothing with it...

Olivier

-- 
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: JavaScriptException during JSNI call: Invoking an instance method on a null instance

2010-03-23 Thread Olivier Monaco
ChrisK,

For instance method, you need to reference the method from the
instance like th...@ Here is my exact code that compile:

private native void installListener()
/*-{
var callback = $entry(this.
@net.antidot.gwtcommon.mvp.share.client.channel.HTML5MessageChannel::process(Lnet/
antidot/gwtcommon/mvp/share/client/channel/HTML5MessageEvent;));
$wnd.addEventListener(message, (function(callback, channel) {
return function(event) {
callback.call(channel, event);
};
})(callback, this), false);;
}-*/;

Sorry, I forgot that...

Olivier

On 23 mar, 13:58, ChrisK cknow...@gmail.com wrote:
 Actually, Olivier's methods work in development mode but don't seem to
 compile with this error:

 Cannot make an unqualified reference to the instance method callback

 I've tried the pre-assignment of this to var that and also an
 argument to the JSNI method passing in my instance. I've tried both of
 these with Olivier's first method as well as the second to avoid
 leaks. All with the same result - working in development mode but not
 when I compile.

 It looks to me as though the compiler doesn't understand the call
 method or the closure correctly. It looks at though it's trying to
 parse the @mypackage.MyClass::MyMethod() and seeing it's an instance
 method so failed (instead of looking at subsequent JavaScript). Of
 course I could quite easily be doing something wrong.

 Thomas - your method compiles fine so I guess I'll use that for now.

 On Mar 23, 10:07 am, ChrisK cknow...@gmail.com wrote:

  Ahhh ok. Sorry for the simple questions but I'm just getting my head
  around all this. I also have some other methods with arguments and
  have those working thanks to both of you.

  On Mar 23, 9:56 am, Olivier Monaco olivier.mon...@free.fr wrote:

   ChrisK,

   On 23 mar, 10:32, ChrisK cknow...@gmail.com wrote:

Thomas - your solution worked from 6 worked but at first I didn't
include both pairs of brackets after the function call MyMethod but
it turns out they are required. With only one set (i.e. no arguments),
it just doesn't work. I thought that was legal but maybe not.

   Remember that @mypackage.MyClass::MyMethod() is a reference to the
   function, not a call. The parenthesis allow you to give the full
   signature of the method. Java allows two methods to have the same name
   but different parameters. GWT needs the full signature to find which
   method you want to reference, even is there is only one method with
   this name.

   The second parenthesis are to call the method. If you forgot then, you
   just obtain the function object and do nothing with it...

   Olivier



a...@a

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



Re: MouseMoveEvent doesn't fire

2010-03-22 Thread Olivier Monaco
Hi,

I think it must be interesting to read
http://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideUiHandlers.html

You need to register your own object to the event system. For example:

public MyTree() {
  addDomHandler(MouseMoveEvent.getType() this);
}

Olivier

On 22 mar, 12:16, shahid shahidza...@gmail.com wrote:
 Sorry the MyTree class does implement the interface as well :

 class MyTree extends Composite implements IsDnDContainer {
   ..

 }

 On Mar 22, 11:07 am, shahid shahidza...@gmail.com wrote:

  I have written a custom tree using GWT 2.0.4 and am trying to
  implement Drag and Drop for it. I have created an interface as
  follows :

  public interface IsDnDContainer extends MouseUpHandler,
  MouseMoveHandler {
    

  }

  and then I have the tree as follows :

  class MyTree extends Composite {

          public MyTree() {

          }

          @Override
          public void onMouseMove(MouseMoveEvent event) {
                  DraggableTreeAnchor draggedItem = (DraggableTreeAnchor)
  this.getDraggedObject();
          }

  }

  but the event never fires.

  What am I missing 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.



Re: JavaScriptException during JSNI call: Invoking an instance method on a null instance

2010-03-22 Thread Olivier Monaco
Hi ChrisK,

You need to understand how JavaScript works.

Like in many languages, the this keyword means the current object.
The JavaScript language allows you to manipulate code as a function.
This function can be affected to any variable or object member, like:

$wnd.js_callback = function() { ... }

Then, you can call your code like this:

$wnd.js_callback()

In the function body, the this variable is $wnd. If you assign the
same function to the member of another object, the this variable
will be equal to the new object.

From JSNI, @mypackage.MyClass::MyMethod() references the JavaScript
function corresponding to the MyMethod method of mypackage.MyClass.
This method can be static or not, the reference is the same (no need
of this before @... just to obtain the JavaScript function).
Calling $entry just add a function wrapper around it but it stay a
function. When you assign this function to $wnd.js_callback, the
this variable inside of the function will be $wnd. If MyMethod is
static, it's okay. If MyMethod is not static, GWT will probably cast
the $wnd to a MyClass... it's bad...

The call method of a JavaScript function allows you to call it with
a differente this. Then, using $wnd.js_callback.call(otherObject),
the this variable reference otherObject. So the glue is:

var that = this;
$wnd.js_callback = function() {
$entry(@mypackage.MyClass::MyMethod()).call(that);
}

When js_callback will be called, MyMethod is called on that, the
JavaScript object representing the MyClass instance. Finally, to avoid
memory leaks of closure:

$wnd.js_callback = (function(obj) {
return function() {
$entry(@mypackage.MyClass::MyMethod()).call(obj);
};
})(this);

And remember, for static methods it's just:

$wnd.js_callback = $entry(...);

Good luck,

Olivier

On 22 mar, 20:16, ChrisK cknow...@gmail.com wrote:
 Thanks for the reply!

 I'm not sure I understand why this evaluates to the plain JS
 context. I was going off the documentation here which seems to suggest
 you can use this in this 
 way:http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI...

 Or perhaps you just can't use it for $entry type JSNI?

 Having said that, I've updated to a non-static method - silly me. I
 did actually try that first but only pasted in my last attempt at
 getting some working code. I have tried both of the below now with the
 same stack trace as a result. Note, there are not actually any spaces
 before the .@ in my code I'm just working around Google Groups
 mangling it.

 private native void initialiseCallbacks() /*-{
     var that = this;
     $wnd.js_callback =
 $entry(that @com.mine.playerimpl::callback());

 }-*/;

 and

 private native void initialiseCallbacks(PlayerImpl pl) /*-{
     $wnd.js_callback = $entry(pl @com.mine.playerimpl::callback());

 }-*/;

 On Mar 22, 5:17 pm, Thomas Broyer t.bro...@gmail.com wrote:

  On Mar 22, 4:23 pm, ChrisK cknow...@gmail.com wrote:

   My above code got a little mangled along the way, the $entry part has
   (this, followed by a full stop, followed by
   @com.mine.PlayerImpl::callback());

  And that's the problem: this is a special keyword and will evaluate
  to the this context of the calling plain JS code, whereas you'd
  want it to be some PlayerImpl instance.

  There are several ways to fix this:
    // evaluates this right now
    var that = this;
    // then uses that
    $wnd.js_callback = $entry(t...@com.mine.playerimpl::callback());

  or pass the instance as an argument to the method and then use its
  name.

  But there's another bug in your code: there's no this in a static
  method!

-- 
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: Inter-frame communication

2010-03-20 Thread Olivier Monaco
Hi,

I'm working on a front with a global portal as a placeholder for
applications. Each application is an independent GWT module opened in
an iframe. The portal and all applications can talk one to each other.
Each application can send messages to the portal about it state
(working, title...). But the main feature is to have only one
connection to the server shared by all applications. The portal has a
data manager which manage data exchange with the server
(authentication, caching...). All application ask data to the portal.
When a data object is changed, the portal broadcasts the new object to
all applications... and so on.

So, to answer to your question, I use a messaging system. It's based
on the postMessage method (and it's window.name compatibility
implementation). I'm using a bootstrap process that allows a new
application to discover all other applications and register itself to
them. Then, I exchange JSON object (serialized as a String). It's for
me the best way because I never used GWT-RPC. Instead, we have a REST
server offering data as JSON object. A tool use server classes to
produce GWT classes which works have proxy to JavaScriptObject. For
better understand, a little piece of code:

- A special JavaScriptObject (not data-specific) to mange JSON with
ease
public class JsObject extends JavaScriptObject {
...
public native final String getString(String name)
/*-{
return this[name];
}-*/;
...
}

- A data-class (generated) which wraps a JSON object
public class MyData {
private JsObject jso;
...
public String getName()
{
return jso.getString(name);
}
...
}

- The unserialization process

String data = data from server/messaging system ;
JavaScriptObject jso = eval(data);
MyData result = new MyData((JsObject)jso.cast());

To send object through the messaging system, we just serialize the
JavaScriptObject as a String. On the other end, we just eval the
String and create instantiate a GWT-class to wrap the JSON object. The
benefits are: zero overhead for serialization/unserialization and same
process for data coming from/going to the server, the messaging
system, a storage system (cookie, HTML 5...)...

I hope this help.

Olivier

On 19 mar, 15:54, Jonathan Hunt j...@42quarks.com wrote:
 Hi

 Thanks for your help. I guess my question wasn't so much how to do but
 more advice on a good, clean way of implementing it in gwt. Basically
 I want interframe rpc. Something like the server rpc in gwt where you
 don't have to manually deal with serialization etc. I was hoping
 someone might have done something similar and might have a few pointer
 on the best way of architecturing it cleanly since I'm fairly new to
 gwt.

 Thanks for any help
 J



 On Friday, March 19, 2010, Pondmouse pondmo...@googlemail.com wrote:
  I did something similar by writing native javascript. See here
 http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-g...

  I had trouble getting the embedded iframes call the javascript
  functions. See herehttp://www.dyn-web.com/tutorials/iframes/

  Managed to call the javascript functions using top.functionname()

  On Mar 19, 6:23 am, Sudeep S sudee...@gmail.com wrote:
  hey Jonny,

  jquery has a plugin for window.post that works for all browsers.
  i've used that with gwt for resizing cross domain iframe.
  you can give that a shot.

  On Thu, Mar 18, 2010 at 2:08 PM, jjh j...@42quarks.com wrote:
   Hi,

   I am wanting allow extensions to my website (essentially third-party
   javascript code that can provide response to certain events, sort of
   simplified, gui-less gadgets). It seems like the safest way to this is
   to use iframes and inter-frame communication to limit what the third-
   party code can do (to some extent).

   So now I need to be able to post events to the gadget-frames and
   receive responses (basically RPC between frames). I know this can be
   done in javascript using postMessage (window.name hacks for older
   browsers). But I'm not sure what the best way to do this in GWT is.
   Does anyone have any pointers for a clean way of doing this in GWT.

   Regards,
   Jonny

   --
   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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.


Re: DOM.appendChild clickListener not working

2010-03-15 Thread Olivier Monaco
Hi,

I think you need to read the manual :
http://code.google.com/intl/fr/webtoolkit/doc/latest/tutorial/buildui.html

Adding a panel to the HTML page is not just inserting the DOM
element...

Olivier

On 15 mar, 08:33, Šobis matej.poklu...@gmail.com wrote:
 Hello,

 I have a problem with click listener.

 Below is code. Click listener is simply not working. What am I doing
 wrong?

               HorizontalPanel backgroundPanel = new HorizontalPanel();
               backgroundPanel.setStyleName(spodnjiTabPanelGround);

               /*najprej naredimo oba gumba da vemo njihova indeksa*/
               Button gumbLevoSh = new Button();
               gumbLevoSh.setStyleName(spodnjiTabgumbLevo);
               Window.alert(Dodamo clicker pervi);
               gumbLevoSh.addClickHandler(new ClickHandler(){
                         public void onClick(ClickEvent event) {
                          Window.alert(Levo);
                         }
               });

 .

               backgroundPanel.add(gumbLevoSh);
               DOM.appendChild((Element)
 Document.get().getElementById(fragment-1),
 backgroundPanel.getElement());

 best Matej

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