Re: Unable to load Module in embedded IE / OCX

2014-07-23 Thread Johann Regier
Hi, Experts again

the Exception is thrown on last line - styleElement.appendChild( cssText );

cssText = Document.get().createTextNode();

StyleElement styleElement = Document.get().createStyleElement();
styleElement.setType(text/css);
styleElement.appendChild(cssText);   
  
  
Is this not Part of GWT, to handle this ?

var css = document.createElement('style'); 
css.setAttribute('type', 'text/css'); 
var cssText = ''; 
if(css.styleSheet) { 
// IE does it this way 
   css.styleSheet.cssText = cssText 
} else { 
// everyone else does it this way 
css.appendChild(document.createTextNode(cssText)); 
}




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


Best way (performance) to build a view like Pinterest

2014-07-23 Thread marian lux
I see that my question in the mgwt section is a little bit off-topic. It 
seems to be a general GWT-question. So I will post it in this forum - see 
the link below:
https://groups.google.com/d/msg/mgwt/4-jutvge5R0/Pq9S2iJyTI0J

I hope someone with experience (in performance and designing gwt/web-ui's) 
can help me how to build a view like Pinterest (inhomogeneous elements with 
different heights and high performance on scrolling - like a celllist).

Thanks,
Marian

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


general question about data handling

2014-07-23 Thread Gary Berkowitz
i am new to gwt and a fairly inexperienced developer.  i have written a 
java project that steps a user through an interview.  the structure is 
based on a linked list.  each node contains an object that consists of five 
string fields and one hash table.  the data file is in xml format and i use 
dom to populate the nodes.  the front end gui presents either a set of 
check boxes or radio buttons as response choices to a question.  there are 
four buttons: accept as is and go to the next node, go back, ignore the 
choices and type freely, and accept the choice but add to it.  nothing 
fancy but it works.

i am trying to convert the project to a web ap.  the client side gui is no 
problem.  but i am having difficulty conceptualizing the data exchange.  in 
my mind, everything should be processed on the server side and then the 
data object can be passed back to the client where gwt can do its html 
magic conversion.  but i can't find a lot of info on this type of structure 
so i am starting to think my concept is wrong.almost every piece of 
info i can find including the gwt tutorial sends the data directly to the 
client.  if that is the case, what is left for the server to do?  and does 
that create security problems by having everything available on the client 
side?  also. i just read that gwt doesn't really support linked lists so i 
am not even sure that i can use that structure on the client side.  

any help would be appreciated.

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


Re: GWT JS Interopt

2014-07-23 Thread 田传武
See the Live Playground http://realtimeplayground.goodow.com/bus.html and
the generated js library https://github.com/goodow/bower-realtime-channel.
What does the trick is:
https://github.com/goodow/realtime-channel/blob/master/src/main/java/com/goodow/realtime/html/HtmlScheduler.java#L46-L52


On Wed, Jul 23, 2014 at 10:28 AM, Cristian Rinaldi csrina...@gmail.com
wrote:

 I have the same problem with addEventListener, the generated code is not
 exactly as you mention:

 This is my code:

 public interface EventListenerE extends JsObject {
 void onEvent(E event);
 }

 @JsType(prototype = HTMLElement)
 public interface HTMLElement extends Element {

 public void setAttribute(String align, String center);

 public void appendChild(HTMLElement element);

 public void addEventListener(String event, EventListener? extends
 JsObject handler);

 @JsProperty
 public void setInnerHTML(String text);

 @JsProperty
 public void setInnerText(String text);
 }

 .
 HTMLElement button = doc.createElement(button);
 .
 .
 button.setInnerText(UPDATE - See the console);

 button.addEventListener(click, new EventListenerJsObject() {
 @Override
 public void onEvent(JsObject event) {
 window().getConsole().log(event);
 }
 });

 
 
 
 body.appendChild(button);
 .
 

 This is the generated code:

  _.onModuleLoad = function() {
   var body_0, button, div, input_0, observer, p, person;
   body_0 = $wnd.document;
   div = body_0.createElement(DIV);
   p = body_0.createElement(P);
   input_0 = body_0.createElement(input);
   button = body_0.createElement(button);
   body_0 = $wnd.document.body;
   person = new clgscm$Person;
   observer = new $wnd.PathObserver(person, name);
   input_0.bind(value, observer);
   person.name = Cristian;
   button.innerText = UPDATE - See the console;
 *  button.addEventListener(click, new clgsc$gwt_sample$01(this));*
   $wnd.console.log(%cWelcome to JSInterop!%c,
 initValues(jl$getClassLiteralForArray_0(cggl$Ljava_lang_String_2_classLit,
 1), $intern_2, 2, 4, [font-size:1.5em;color:#4558c9;,
 color:#d61a7f;font-size:1em;]));
   div.appendChild(p);
   div.appendChild(input_0);
   body_0.appendChild(div);
   body_0.appendChild(button);
 };

 createForClass(61, cggl$Ljava_lang_Object_2_classLit);
 *function clgsc$gwt_sample$01(this$0) {*
 *  this.this$01 = this$0;*
 *  jl$$0init__V__devirtual$0(this);*
 *}*

 Any Suggestion?

 Thanks!!!


 El martes, 22 de julio de 2014 07:16:06 UTC-3, 田传武 escribió:

 Yes, i didn't use addEventListener. But i has a similar usage:
 Java
 Bus.subscribe(String topic, Handler? extends Message handler);
 https://github.com/goodow/realtime-channel/blob/master/src/main/java/com/goodow/realtime/channel/Bus.java#L108
 translated to js

 bus.subscribe(some/topic, function(message) {
   var body = message.body();
   console.log(Name:  + body.name);});




 On Tue, Jul 22, 2014 at 5:41 PM, Henrik henri...@gmail.com wrote:

 A bonus issue, I saw you did not use addEventListener like the demo
 does, and I really struggled to make it work.  The generated javascript
 looks like addEventListener('click', new xxx(this)) which doesn't work
 (the key thing here being new I'd guess).  I found no other way to call
 it directly and eventually resorted to doing it from a jsni function
 instead:
  public static native void jsAddEventListener(Element elem,
 String event, EventListener listener) /*-{
 elem.addEventListener(event, function(ev) { listener.onEvent(ev); });
 }-*/;


 Which demo uses addEventListener?


 https://www.youtube.com/watch?v=wFMD1GXR2Tg#t=190

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Google Web Toolkit group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/google-web-toolkit/fGIr4sRkz7s/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 To post to this group, send email to google-we...@googlegroups.com.

 Visit this group at http://groups.google.com/group/google-web-toolkit.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups Google Web Toolkit group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/google-web-toolkit/fGIr4sRkz7s/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-web-toolkit.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web 

[ERROR] Unable to find *.gwt.xml on your classpath

2014-07-23 Thread Marco
Hello all, 

I need some help with GWT. We have a Java project and we use GWT to build 
the UI, the structure of my project is something similar to this:
ProjectA
|
|--Server/Common/src
   |-com.abc.core
  |-util.gwt.xml
   |-com.abc.core.util (Package)
  |- test.java

|
|--Common/src
|-com.abc.gwt
 |-ws.gwt.xml
|-com.abc.gwt.client
 |- HP.java

I want to use a method that is in test.java from HP.java, for that I have 
created util.gwt.xml

?xml version=1.0 encoding=UTF-8?
module
  inherits name='com.google.gwt.user.User'/
  source path=util/source
/module

and modified the ws.gwt.xml

..
inherits name=com.abc.core.util/

entry-point class='com.abc.gwt.client.HP'/

When I try to compile the code I am getting this error:

compile.gwt:
[mkdir] Created dir: c:\Test_trunk_217\build\server\gwt
 [java] Loading inherited module 'com.abc.gwt.wsdev'
 [java]Loading inherited module 'com.abc.core.util'
 [java]   [ERROR] Unable to find 'com/abc/core/util.gwt.xml' on 
your classpath; could be a typo, or maybe you forgot to include a classpath 
entry for source?
 [java][ERROR] Line 14: Unexpected exception while processing 
element 'inherits'

Please give me a hand.

Thanks.

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


Re: Unable to load Module in embedded IE / OCX

2014-07-23 Thread Thomas Broyer


On Wednesday, July 23, 2014 9:59:00 AM UTC+2, Johann Regier wrote:

 Hi, Experts again

 the Exception is thrown on last line - styleElement.appendChild( cssText );

 cssText = Document.get().createTextNode();
 
 StyleElement styleElement = Document.get().createStyleElement();
 styleElement.setType(text/css);
 styleElement.appendChild(cssText);   
   
   
 Is this not Part of GWT, to handle this ?

 var css = document.createElement('style'); 
 css.setAttribute('type', 'text/css'); 
 var cssText = ''; 
 if(css.styleSheet) { 
 // IE does it this way 
css.styleSheet.cssText = cssText 
 } else { 
 // everyone else does it this way 
 css.appendChild(document.createTextNode(cssText)); 
 }




If you used high-level APIs like StyleInjector, then yes GWT would handle 
that for you; but when a workaround is needed in 0.001% of the cases and 
would have a performance impact on the other 99.999%, then GWT let's you do 
it yourself. Node#appendChild(Node) is such a case: if, in IE, which is 
already slower than the other browsers (at least older versions that need 
the workaround), you'd have to check if this looks like a style element 
and the node being appended is a text node, then do it that way then your 
app would be sluggish and barely usable.

My advice is to change your code to use StyleInjector (or a CssResource).
 

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


Re: [ERROR] Unable to find *.gwt.xml on your classpath

2014-07-23 Thread Thomas Broyer
What build tool do you use? (looks like Ant) and how's it configured?
You probably forgot to add the Server/Common/src folder to the classpath 
for the GWT Compiler, or if you package Server/Common as a JAR then you 
forgot to either include the *.ui.xml *and* *.java in the JAR, or create a 
sources JAR with the *.ui.xml and *.java (to be used alongside of instead 
of the normal JAR in the classpath for the GWT Compiler).

On Tuesday, July 22, 2014 10:59:40 PM UTC+2, Marco wrote:

 Hello all, 

 I need some help with GWT. We have a Java project and we use GWT to build 
 the UI, the structure of my project is something similar to this:
 ProjectA
 |
 |--Server/Common/src
|-com.abc.core
   |-util.gwt.xml
|-com.abc.core.util (Package)
   |- test.java
 
 |
 |--Common/src
 |-com.abc.gwt
  |-ws.gwt.xml
 |-com.abc.gwt.client
  |- HP.java

 I want to use a method that is in test.java from HP.java, for that I have 
 created util.gwt.xml

 ?xml version=1.0 encoding=UTF-8?
 module
   inherits name='com.google.gwt.user.User'/
   source path=util/source
 /module

 and modified the ws.gwt.xml

 ..
 inherits name=com.abc.core.util/
 
 entry-point class='com.abc.gwt.client.HP'/

 When I try to compile the code I am getting this error:

 compile.gwt:
 [mkdir] Created dir: c:\Test_trunk_217\build\server\gwt
  [java] Loading inherited module 'com.abc.gwt.wsdev'
  [java]Loading inherited module 'com.abc.core.util'
  [java]   [ERROR] Unable to find 'com/abc/core/util.gwt.xml' on 
 your classpath; could be a typo, or maybe you forgot to include a classpath 
 entry for source?
  [java][ERROR] Line 14: Unexpected exception while processing 
 element 'inherits'

 Please give me a hand.

 Thanks.


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


Select locale using custom URL parameter

2014-07-23 Thread Beñat Lizarazu
Hi all,

Is it possible to change the name of the URL parameter which tells GWT what 
language should load to be a custom parameter instead of locale?

For example instead of being:

http://myapp.com/?locale=en 


it would be:

http://myapp.com/?language=en 


I need to change the name because I don't have control over the final host 
page and the URLs from which the language will be loaded, although they 
have a specific parameter to choose the locale (which name is not locale, 
of course).

Thank you.

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


splitlayoutpanel with celltable wrapped in scrollpanel

2014-07-23 Thread Moritz
Hello,

I have a splitlayoutpanel with a simple list added to west and the center 
contains a dynamic number of celltabels in a vertical panel (the celltable is 
wrapped in a scrollpanel because it might have over  20 columns)

My current solution:

Splitlayoutpanel in its center a simple flowpanel with its overflow y set to 
auto
Ontop of that a vertical panel on each cell of the vertical panel a celltable 
wrapped in a scrollpanel. 

However thats not the best solution..
Right now i need a windowresize handler to calculate the width of each 
scrollpanel. When i resize the layoutpanel with its splitter no resize event is 
ofc thrown and nothing happens.

I need a better Layout Management i guess.
 Hope you can help me

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


Re: Select locale using custom URL parameter

2014-07-23 Thread Jens
Sure,

set-configuration-property name=locale.queryparam value=language/

You can also use other mechanisms to get locale information for GWT. Take a 
look at I18N.gwt.xml

-- J.

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


Re: Unable to load Module in embedded IE / OCX

2014-07-23 Thread Johann Regier
Thank you very much - i has supposed that i should do with StyleInjector. 
I'm not 100% familiar with GWT, not the beginner, but not even discovered 
all corners of GWT :-)

Thank you for Help.

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


Re: GWT JS Interopt

2014-07-23 Thread Cristian Rinaldi
HTMLElement implementation is done by the GWT compiler, so the code you say 
I would not know how to incorporate it. 

For example, I am using Polymer PathObserver:

public interface OpenObserverListener {
  void onOpen(String oldValue, String newValue);
}




@JsType(prototype = PathObserver)
public interface PathObserver {
  void open(OpenObserverListener handler);
}




PathObserver observer1 = PathObserverFactory.createObserver(person, name);
observer1.open(new OpenObserverListener() {
  @Override
  public void onOpen(String oldValue, String newValue) {
window().getConsole().log(oldValue);
window().getConsole().log(newValue);

  }
});


And I have the same problem, 
sorry if I have not understood what you have told me. 

Any idea?

Thanks.

El miércoles, 23 de julio de 2014 05:56:19 UTC-3, 田传武 escribió:

 See the Live Playground http://realtimeplayground.goodow.com/bus.html and 
 the generated js library 
 https://github.com/goodow/bower-realtime-channel.
 What does the trick is:

 https://github.com/goodow/realtime-channel/blob/master/src/main/java/com/goodow/realtime/html/HtmlScheduler.java#L46-L52


 On Wed, Jul 23, 2014 at 10:28 AM, Cristian Rinaldi csri...@gmail.com 
 javascript: wrote:

 I have the same problem with addEventListener, the generated code is not 
 exactly as you mention: 

 This is my code:

 public interface EventListenerE extends JsObject {
 void onEvent(E event);
 }

 @JsType(prototype = HTMLElement)
 public interface HTMLElement extends Element {

 public void setAttribute(String align, String center);

 public void appendChild(HTMLElement element);

 public void addEventListener(String event, EventListener? 
 extends JsObject handler);

 @JsProperty
 public void setInnerHTML(String text);

 @JsProperty
 public void setInnerText(String text);
 }

 .
 HTMLElement button = doc.createElement(button);
 .
 .
 button.setInnerText(UPDATE - See the console);

 button.addEventListener(click, new EventListenerJsObject() {
 @Override
 public void onEvent(JsObject event) {
 window().getConsole().log(event);
 }
 });

 
 
 
 body.appendChild(button);
 .
 

 This is the generated code:

  _.onModuleLoad = function() {
   var body_0, button, div, input_0, observer, p, person;
   body_0 = $wnd.document;
   div = body_0.createElement(DIV);
   p = body_0.createElement(P);
   input_0 = body_0.createElement(input);
   button = body_0.createElement(button);
   body_0 = $wnd.document.body;
   person = new clgscm$Person;
   observer = new $wnd.PathObserver(person, name);
   input_0.bind(value, observer);
   person.name = Cristian;
   button.innerText = UPDATE - See the console;
 *  button.addEventListener(click, new clgsc$gwt_sample$01(this));*
   $wnd.console.log(%cWelcome to JSInterop!%c, 
 initValues(jl$getClassLiteralForArray_0(cggl$Ljava_lang_String_2_classLit, 
 1), $intern_2, 2, 4, [font-size:1.5em;color:#4558c9;, 
 color:#d61a7f;font-size:1em;]));
   div.appendChild(p);
   div.appendChild(input_0);
   body_0.appendChild(div);
   body_0.appendChild(button);
 };

 createForClass(61, cggl$Ljava_lang_Object_2_classLit);
 *function clgsc$gwt_sample$01(this$0) {*
 *  this.this$01 = this$0;*
 *  jl$$0init__V__devirtual$0(this);*
 *}*

 Any Suggestion?

 Thanks!!!


 El martes, 22 de julio de 2014 07:16:06 UTC-3, 田传武 escribió:

 Yes, i didn't use addEventListener. But i has a similar usage:
 Java
 Bus.subscribe(String topic, Handler? extends Message handler); 
 https://github.com/goodow/realtime-channel/blob/master/src/main/java/com/goodow/realtime/channel/Bus.java#L108
 translated to js

 bus.subscribe(some/topic, function(message) {
   var body = message.body();
   console.log(Name:  + body.name);});




 On Tue, Jul 22, 2014 at 5:41 PM, Henrik henri...@gmail.com wrote:

 A bonus issue, I saw you did not use addEventListener like the demo 
 does, and I really struggled to make it work.  The generated javascript 
 looks like addEventListener('click', new xxx(this)) which doesn't work 
 (the key thing here being new I'd guess).  I found no other way to 
 call 
 it directly and eventually resorted to doing it from a jsni function 
 instead:
  public static native void jsAddEventListener(Element elem, 
 String event, EventListener listener) /*-{
 elem.addEventListener(event, function(ev) { listener.onEvent(ev); });
 }-*/;


 Which demo uses addEventListener?


 https://www.youtube.com/watch?v=wFMD1GXR2Tg#t=190

  -- 
 You received this message because you are subscribed to a topic in the 
 Google Groups Google Web Toolkit group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/google-web-toolkit/fGIr4sRkz7s/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 

JsInterop and EventListener

2014-07-23 Thread Cristian Rinaldi
I'm doing tests with JsInterop (JsType, JsExport, etc), and I encounter a 
problem when adding a listener. 

Part of my code:

@JsType(prototype = HTMLElement)
public interface HTMLElement extends Element {
   public void setAttribute(String align, String center);
   public void appendChild(HTMLElement element);
   public void addEventListener(String event, EventListener? extends 
JsObject handler);
   @JsProperty
   public void setInnerHTML(String text);
   @JsProperty
   public void setInnerText(String text);
}

HTMLElement button = doc.createElement(button);
HTMLBodyElement body = bodyElement();

button.setInnerText(UPDATE - See the console);

button.addEventListener(click, new EventListenerJsObject() {
@Override
public void onEvent(JsObject event) {
window().getConsole().log(event);
}
});

The handler is never executed...

The code generated for copiler is:

_.onModuleLoad = function() {
  var body_0, button, div, input_0, observer, p, person;
  body_0 = $wnd.document;
  div = body_0.createElement(DIV);
  p = body_0.createElement(P);
  input_0 = body_0.createElement(input);
  button = body_0.createElement(button);
  body_0 = $wnd.document.body;
  person = new clgscm$Person;
  observer = new $wnd.PathObserver(person, name);
  input_0.bind(value, observer);
  (new $wnd.PathObserver(person, name)).open(new clgsc$gwt_sample$01(this
));
  person.name = Cristian;
  person.name = Cristiaa;
  button.innerText = UPDATE - See the console;
*  button.addEventListener(click, new clgsc$gwt_sample$02(this));*
  $wnd.console.log(%cWelcome to JSInterop!%c, initValues(
jl$getClassLiteralForArray_0(cggl$Ljava_lang_String_2_classLit, 1),
 $intern_2, 2, 4, [font-size:1.5em;color:#4558c9;, 
color:#d61a7f;font-size:1em;]));
  div.appendChild(p);
  div.appendChild(input_0);
  body_0.appendChild(div);
  body_0.appendChild(button);
};
.
.
createForClass(62, cggl$Ljava_lang_Object_2_classLit);
*function clgsc$gwt_sample$02(this$0) {*
*  this.this$01 = this$0;*
*  jl$$0init__V__devirtual$0(this);*
*}*

---


The generated code should be 

button.addEventListener(click, function(e){...});

I think so ... :)

Any Idea?
Thanks...

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


Re: JsInterop and EventListener

2014-07-23 Thread Cristian Rinaldi
I resolve this problem, 
If not an elegant solution, maybe the compiler should do it automatically, 
but the most instructed to answer this question is +RayCromwell
My solution was to make a small JSNI functions that return the object 
generated by JsType getting the same object as a parameter. 

Here's an example:

@JsType(prototype = HTMLElement)
public interface HTMLElement extends Element {
  public void setAttribute(String align, String center);
  public void appendChild(HTMLElement element);
  public void addEventListener(String event, EventListener? extends 
JsObject handler);

  @JsProperty
  public void setInnerHTML(String text);

  @JsProperty
  public void setInnerText(String text);
}

@JsType
public interface EventListenerE extends JsObject {
   void onEvent(E event);
}

public static native EventListener eventListener(EventListener handler) /*-{
 return function(evt){
 handler.onEvent(evt);
 }
}-*/;

@Override
public void onModuleLoad() {
  Document doc = getDocument();

  HTMLElement button = doc.createElement(button);
  HTMLBodyElement body = bodyElement();


  final Person person = new Person();
  PathObserver observer = PathObserverFactory.createObserver(person, name
);
  input.bind(value, observer);


  PathObserver observer1 = PathObserverFactory.createObserver(person, name
);
  observer1.open(eventListener(new OpenObserverListener() {
 @Override
 public void onOpen(String oldValue, String newValue) {
   window().getConsole().log(oldValue);
 }
   }));
   person.setName(Cristian);

   button.setInnerText(UPDATE - See the console);


   button.addEventListener(click, eventListener(new EventListener() {
  @Override
  public void onEvent(JsObject event) {
window().getConsole().log(person);
  }
   }));
   .
   body.appendChild(button);
 }

The all code in my Github:

https://github.com/csrinaldi/samples-of-gwt/tree/master/gwt-playground

Thanks!!!

El miércoles, 23 de julio de 2014 10:54:42 UTC-3, Cristian Rinaldi escribió:

 I'm doing tests with JsInterop (JsType, JsExport, etc), and I encounter a 
 problem when adding a listener. 

 Part of my code:

 @JsType(prototype = HTMLElement)
 public interface HTMLElement extends Element {
public void setAttribute(String align, String center);
public void appendChild(HTMLElement element);
public void addEventListener(String event, EventListener? extends 
 JsObject handler);
@JsProperty
public void setInnerHTML(String text);
@JsProperty
public void setInnerText(String text);
 }

 HTMLElement button = doc.createElement(button);
 HTMLBodyElement body = bodyElement();

 button.setInnerText(UPDATE - See the console);

 button.addEventListener(click, new EventListenerJsObject() {
 @Override
 public void onEvent(JsObject event) {
 window().getConsole().log(event);
 }
 });

 The handler is never executed...

 The code generated for copiler is:

 _.onModuleLoad = function() {
   var body_0, button, div, input_0, observer, p, person;
   body_0 = $wnd.document;
   div = body_0.createElement(DIV);
   p = body_0.createElement(P);
   input_0 = body_0.createElement(input);
   button = body_0.createElement(button);
   body_0 = $wnd.document.body;
   person = new clgscm$Person;
   observer = new $wnd.PathObserver(person, name);
   input_0.bind(value, observer);
   (new $wnd.PathObserver(person, name)).open(new clgsc$gwt_sample$01(
 this));
   person.name = Cristian;
   person.name = Cristiaa;
   button.innerText = UPDATE - See the console;
 *  button.addEventListener(click, new clgsc$gwt_sample$02(this));*
   $wnd.console.log(%cWelcome to JSInterop!%c, initValues(
 jl$getClassLiteralForArray_0(cggl$Ljava_lang_String_2_classLit, 1),
  $intern_2, 2, 4, [font-size:1.5em;color:#4558c9;, 
 color:#d61a7f;font-size:1em;]));
   div.appendChild(p);
   div.appendChild(input_0);
   body_0.appendChild(div);
   body_0.appendChild(button);
 };
 .
 .
 createForClass(62, cggl$Ljava_lang_Object_2_classLit);
 *function clgsc$gwt_sample$02(this$0) {*
 *  this.this$01 = this$0;*
 *  jl$$0init__V__devirtual$0(this);*
 *}*


 ---


 The generated code should be 

 button.addEventListener(click, function(e){...});

 I think so ... :)

 Any Idea?
 Thanks...


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


Re: How to dynamically choose locale at SuperDevMode compile time?

2014-07-23 Thread Davide Cavestro
Hey guys, no idea at all? I would need a way to set the locale for the 
super dev mode compile (even from dedicated bookmarklets would be enough...)

On Friday, July 18, 2014 4:10:50 PM UTC+2, Davide Cavestro wrote:

 It seems that the super dev mode cannot benefit from the meta tag 
 https://code.google.com/p/google-web-toolkit/issues/detail?id=8175 defined 
 within a dynamic host page. I originally tried switching to the cookie 
 solution, but now I guess the compilation triggered by the bookmarklet 
 simply ignores any locale-related info derived from the host page, such as 
 the meta property, the query param and the cookie (set on host page domain).
 But this way - supposed the gwt locale should reflect some data coming 
 from a database - we have no way to make the superdevmode aware of the 
 chosen locale.

 Moreover, Thomas Broyer recently suggested 
 http://stackoverflow.com/a/16295300/2652766 to

 set the locale property to the full list of supported locales:
 set-property name=locale value=en,fr /

 in order to achieve dynamic internationalization. I thought simply 
 extending the locale property with additional values was enough, but I've 
 found no documentation talking about multiple values for this property.
 But as soon as I define multiple values for the locale property, the 
 SuperDevMode starts compiling too many permutations, eventually complaining 
 *Multiple 
 fragment 0 sourcemaps found. Too many permutations.*
 I guess this happens because it has no way to reduce the permutations 
 based on the chosen locale (in fact it doesn't log any *binding: 
 locale=...*).

 So my question is: what should I do in order to dynamically choose the 
 locale used by SDM compiler?



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


Code splitting with dependency injection (gin)

2014-07-23 Thread Robert Hoffmann
I am not clear how to enable code splitting, when using dependency 
injection.

At the beginning of my app I load a gin module to setup bindings, e.g. 
bind(WidgetView.class).to(WidgetViewImpl.class).in(Singleton.class);

But by doing so I introduce a dependency to  WidgetViewImpl.class which 
prevents the code splitting.

I tried using AsyncProvider but the early dependency to the GinInjector 
remains and code splitting is also prevented.

How can I resolve this? Thank you

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


[gwt-contrib] CLA problem

2014-07-23 Thread Michael Vogt
Hello.

When I push to gerrit right now, I get this error back:

https://gwt.googlesource.com/gwt: Individual contributor agreement
requires current contact information.

Looks like I can't edit/remove agreement myself, so what needs to be done?


Thanks,
Michael

-- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAAfA4FxU1rZ9r5afymuGh4XAdO9JVna5AYjtezCa%3D65chTvabA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: Dropping IE8 support in useragent-less GWT

2014-07-23 Thread James Nelson
 Just to toss in another use case...
 
I develop a cross-platform java library that exposes generic apis that run 
on multiple platforms;
each module inherits the minimum possible dependencies, and all 
platform-specific code is isolated from shared APIs.

I never touch anything in User unless I specifically need to write an 
implementation that integrates with some other project,
and such dependencies never, ever make it into the shared modules.
Elemental or even just java emul is plenty to create a module of generic 
functionality,
and I'm very pleased that GWT is keeping its permutations where they belong.

With Elemental being built against webkit's hmtl5 IDLs, it can be the 
single permutations standards way (tm),
with c.g.g.user for all legacy code.

If you need to support ancient browsers, do the enterprise thing and bend 
over backwards to maintain support. 
If you just want to leverage java in a javascript world, then GWT does that 
too.

Win-win, I'd say. :)

-- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/bc7863a7-2f63-409c-a6f2-ab2e397e5354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.