Re: GWT 2.7.0 DevMode not allowing multiple GWT Modules

2015-05-02 Thread Thomas Broyer
IIRC this could be due to a cache expiration in the mapping from module 
short names (e.g. portal) to their fully-qualified name (e.g. 
com.xyz.ModuleB).
One workaround *could* be to load both modules fast enough after DevMode 
startup that the mapping is not reclaimed.

On Saturday, May 2, 2015 at 10:04:25 AM UTC+2, tbb wrote:

 I've migrated a Maven based GWT project from GWT 2.5 to 2.7. The project 
 has 2 GWT Modules (.gwt.xml) within one Maven project. In GWT 2.5 I was 
 able to start DevMode and point the browser to the host page of either 
 module and all worked fine.

 My POM looked like this:

 runTarget${gwt.hostPageModuleA}/runTarget
 modules
 modulecom.xyz.ModuleA/module
 modulecom.xyz.ModuleB/module
 /modules

 Now with GWT 2.7 (still using classic DevMode), DevMode only works for 
 the module which has its hostPage configured as runTarget. If I switch the 
 hostPage to moduleB, moduleB works.

 If I'm accessing the module which is not matching the runTarget, I'm 
 getting this error message:

 00:01:19.009 [ERROR] Unable to find 'portal.gwt.xml' on your classpath; could 
 be a typo, or maybe you forgot to include a classpath entry for source?

 Once the runTarget points to the right host page (i.e. restart with a 
 different profile), it works fine.

 Rather cumbersome for me as I'm working on both GWT modules at the same 
 time - I now have to stop DevMode, select another Maven profile which 
 adjusts the hostPage and then start again.

 How can I make that work with GWT 2.7 (and not switch to SuperDevMode)?

 TIA

 Thomas


-- 
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 2.7.0 DevMode not allowing multiple GWT Modules

2015-05-02 Thread tbb


I've migrated a Maven based GWT project from GWT 2.5 to 2.7. The project 
has 2 GWT Modules (.gwt.xml) within one Maven project. In GWT 2.5 I was 
able to start DevMode and point the browser to the host page of either 
module and all worked fine.

My POM looked like this:

runTarget${gwt.hostPageModuleA}/runTarget
modules
modulecom.xyz.ModuleA/module
modulecom.xyz.ModuleB/module
/modules

Now with GWT 2.7 (still using classic DevMode), DevMode only works for 
the module which has its hostPage configured as runTarget. If I switch the 
hostPage to moduleB, moduleB works.

If I'm accessing the module which is not matching the runTarget, I'm 
getting this error message:

00:01:19.009 [ERROR] Unable to find 'portal.gwt.xml' on your classpath; could 
be a typo, or maybe you forgot to include a classpath entry for source?

Once the runTarget points to the right host page (i.e. restart with a 
different profile), it works fine.

Rather cumbersome for me as I'm working on both GWT modules at the same 
time - I now have to stop DevMode, select another Maven profile which 
adjusts the hostPage and then start again.

How can I make that work with GWT 2.7 (and not switch to SuperDevMode)?

TIA

Thomas

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


Synchronized code after a service call

2015-05-02 Thread Alireza Rezaei Mahdiraji

Hi,

I am new in using GWT. 

I make a call to a remote service from within a for loop and update a 
FlexTable in a DialogBox. 
After finishing the loop, I would like to add extra row to the table with 
two button. 
Here is how the code structure looks like: 

initDialogBox(); // instantiate a dialogbox and set the caption and add a 
FlexTable   

for (final String str : strList) {
   configurationsService.testStr(str, 
new AsyncCallbackBoolean() {
@Override
public void onSuccess(Boolean result) {
 updateDialogBox(db, result);  // get the FlextTable and add a 
row to it with db and result as columns 
}

   @Override
public void onFailure(Throwable caught) {
  // some code
}
});
}
finalizeDialogBox(); // add two button to the last row of the table


The problem is it seems finalizeDialogBox() runs before service call 
finishes and table 
appears with two buttons at the first row. 

Any idea how to fix this?

Thanks,
Cheers,
Alireza

-- 
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: Synchronized code after a service call

2015-05-02 Thread Jens
Ok here are some points to make your code better:

1.) First something to understand: Whenever you must provide a callback you 
can be sure that the method requiring the callback is executed 
asynchronous. In fact literally all web APIs that need to wait for 
something are asynchronous because the browser itself only has a single 
thread to execute JavaScript and that thread should never block. If it 
would block then the browser tab would be unusable for the user. So 
JavaScript uses asynchronous APIs and processes work using an event 
dispatch thread. 

2.) You should never really do server requests in a loop unless you really 
know what you do. Server requests are slow and costly (think of mobile) and 
it is always better to fetch the whole list of data in a single request. So 
given your example you would do configurationService.testStrs(allStrings, 
callback) . Also keep in mind because of 1.) there is no guarantee of 
ordering. That means if your for loop does execute your testStr() method 
for A, B, C in order then the server might get these requests in 
order B, A, C and the browser get the server results in order C, 
A, B.

3.) If you do 2.) and request all strings at once you only have a single 
result and thus you could move your finalizeDialogBox() into the 
onSuccess() method of your callback. So it would look like

initDialogBox();
// optional: show some loading indicator
configurationService.testStrings(allStrings, new AsyncCallbackArrayList
Boolean() {

  public void onSuccess(ArrayListBoolean allResults) {
updateDialogBox(db, allResults);
finalizeDialogBox();
// optional: hide loading indicator
  }

  
}


Also note that I have used ArrayList instead of List. The reason is that 
you are using GWT-RPC which generates serializer classes for everything 
that might be transferred between client and server. If I would use List 
then GWT-RPC will generate serializers for all implementations of List even 
though your app might only use ArrayList. That makes the app larger than it 
should. Luckily the List interface does not have that much implementations 
and overhead isn't that much but it is still something to be aware of, 
especially if you use lots of libraries that might have additional List 
implementations.

GWT-RPC generates a file of the form hash.gwt.rpc in your output folder 
which contains all classes that GWT-RPC has detected and generated 
serializers for. It is handy to look into that file from time to time to 
check if lots of unwanted things are detected. Also the GWT compile report 
gives you insight about the final JavaScript size of serializers.

4.) From a user perspective you should make sure to have some loading 
indicator while the table data loads in case the network is slow.


-- 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: CellBrowser not displaying (2.1.0) ...(2.4)

2015-05-02 Thread Vijay Zala
You also need to specify the unit... eg. px, em etc.

Here is the example
CellBrowser browser =new CellBrowser(model,null);
browser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
browser.setHeight(200px);
browser.setWidth(630px);

It should work after this change.

Thanks
Vijay Zala


On Tuesday, July 23, 2013 at 7:56:34 PM UTC+5:30, Salvatore Vitale wrote:


 I'm using GWT 2.4. I'm setting width and height on cellBrovser but 
 nothing...i don'y see nothing!
 That'is my source:

 public void onModuleLoad() {
 // Add the widgets to the root panel.
 
 //solution 1 : OK
 RootLayoutPanel.get().add(createCellBrowser()); 
 
 //soluzione 2 : KO
 //RootPanel.get(gwtContainer).add(createCellBrowser());
 
 //soluzione 3 : KO
 //VerticalPanel vp = new VerticalPanel();
 //vp.add(createCellBrowser());
 //RootPanel.get(gwtContainer).add(vp);
 
 //soluzione 4 : KO
 //initWidget(createCellBrowser());
 
 //soluzione 5 : KO
 //VerticalPanel vp = new VerticalPanel();
 //vp.add(createCellBrowser());
 //initWidget(vp);
 
 }


 private CellBrowser createCellBrowser(){
 // Create a model for the browser.
 TreeViewModel model =new CustomTreeModel();
 /*
 * Create the browser using the model. We use codenull/code as
 * the default value of the root node. The default value will be
 * passed to CustomTreeModel#getNodeInfo();
 */
 CellBrowser browser =new CellBrowser(model,null);
 
 browser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
 browser.setHeight(200);
 browser.setWidth(630);
 return browser;
 }


 I've tried  to set ...extends Composite... for using initWidget 
 method...but nothing...   :|
 I would like set my div conteiner..  :| 

 Il giorno mercoledì 1 dicembre 2010 16:21:51 UTC+1, John LaBanca ha 
 scritto:

 CellBrowser implements RequiresResize, so it needs an unbroken change of 
 parents that all implement ProvidesResize, up to the RootLayoutPanel (not 
 RootPanel).  You can find more documentation about LayoutPanels in the dev 
 guide:

 http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#LayoutPanels

 Alternatively, you can give the CellBrowser an explicit height and width. 

 Thanks,
 John LaBanca
 jlab...@google.com


 On Wed, Dec 1, 2010 at 8:34 AM, sevendays fux...@gmail.com wrote:

 I am having trouble getting a CellBrowser component to display in my
 existing GWT 2.1 project. I have tried both CellBrowserExample1.java
 and CellBrowserExample2.java, by converting the entry point classes to
 VerticalPanels, then adding them to my application. For example, this
 is a modified

 http://google-web-toolkit.googlecode.com/svn/trunk/user/javadoc/com/google/gwt/examples/cellview/CellBrowserExample2.java
 :

public NodeCellBrowser() {
TreeViewModel model = new CustomTreeModel();

/*
 * Create the browser using the model. We use 
 codenull/code
 as the
 * default value of the root node. The default value will be
 passed to
 * CustomTreeModel#getNodeInfo();
 */
CellBrowser browser = new CellBrowser(model, null);

 browser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);

// Add the browser to the root layout panel.
this.add(new Label(This displays fine)); // -- added by me 
 to
 test
this.add(browser); // nothing displays here
this.add(new Label(This also displays fine)); // -- added 
 by
 me to test
}

 The symptoms of the problem are:

 1) No CellBrowser displays; nothing appears on the screen (i.e. at
 this.add(browser)), however the two test labels appear fine.
 2) No exceptions appear in the log, client or server
 3) I have tried putting logging up to DEBUG but nothing additional is
 returned
 4) I have tried stepping through the code and the constructor executes
 fine for the CellBrowser widget.

 My HTML page is set to standards mode; the first line is:

 !doctype html

 I am developing a GWT+GAE solution in Eclipse Helios and running the
 application using the embedded test application server.

 I am using the incubator PagingScrollTable, therefore have the gwt-
 incubator-20101117-r1766.jar in my build path. Is it possible that one
 of these incubator components is conflicting with the CellBrowser?

 I have also tried creating a clean new standalone GWT 2.1 project, and
 running the CellBrowserExample2.java Entry Point class unmodified. It
 works fine.

 This is quite a frustrating problem because no exceptions make it very
 difficult to progress. Any suggestions or recommendations would be
 appreciated.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this 

GWT js for Windows10 Universal Apps?

2015-05-02 Thread darkflame
Just wondering, anyone got any idea if GWT could be used to make Windows10 
desktop apps?

From what I can make out it seems Universal Windows apps can be written 
in Javascript/html and Microsoft has some javascript lib (WinJS 
https://dev.windows.com/en-us/develop/winjs?) to access desktop stuff.

Universal Windows Apps seem to be pretty compatible, Microsoft is 
claiming Universal Windows Apps will run on any of the following;

Hololens,Xbox,Desktop,Laptop,Tablets,Phones and IoT devices (those without 
any screen).

So, essentially, all versions of Windows10 support these same apps, with 
different things being selectively possible on different platforms by 
querying if a feature is available. (does it have a keyboard)

Naturally this makes it quite attractive to develop for - especially if our 
GWT Java code can be made to run on them all.

Any ideas?

-- 
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: Synchronized code after a service call

2015-05-02 Thread Alireza Rezaei Mahdiraji

Hi Jens, 

Thanks for extensive answers, there are several things for me to learn. 

My application is a bit different, I am not loading data from db, rather I 
have a list of db which 
I want to check db connection, and the service will return a pair db,bool 
per each database. 

I want to show the user how this process is progressing and user sees which 
db has been already tested, that 
is why I want to call service per db. 

With this explanation, how do I solve my problem?

Best,
Al


On Saturday, May 2, 2015 at 1:46:32 PM UTC+2, Jens wrote:

 Ok here are some points to make your code better:

 1.) First something to understand: Whenever you must provide a callback 
 you can be sure that the method requiring the callback is executed 
 asynchronous. In fact literally all web APIs that need to wait for 
 something are asynchronous because the browser itself only has a single 
 thread to execute JavaScript and that thread should never block. If it 
 would block then the browser tab would be unusable for the user. So 
 JavaScript uses asynchronous APIs and processes work using an event 
 dispatch thread. 

 2.) You should never really do server requests in a loop unless you really 
 know what you do. Server requests are slow and costly (think of mobile) and 
 it is always better to fetch the whole list of data in a single request. So 
 given your example you would do configurationService.testStrs(allStrings, 
 callback) . Also keep in mind because of 1.) there is no guarantee of 
 ordering. That means if your for loop does execute your testStr() method 
 for A, B, C in order then the server might get these requests in 
 order B, A, C and the browser get the server results in order C, 
 A, B.

 3.) If you do 2.) and request all strings at once you only have a single 
 result and thus you could move your finalizeDialogBox() into the 
 onSuccess() method of your callback. So it would look like

 initDialogBox();
 // optional: show some loading indicator
 configurationService.testStrings(allStrings, new AsyncCallbackArrayList
 Boolean() {

   public void onSuccess(ArrayListBoolean allResults) {
 updateDialogBox(db, allResults);
 finalizeDialogBox();
 // optional: hide loading indicator
   }

   
 }


 Also note that I have used ArrayList instead of List. The reason is that 
 you are using GWT-RPC which generates serializer classes for everything 
 that might be transferred between client and server. If I would use List 
 then GWT-RPC will generate serializers for all implementations of List even 
 though your app might only use ArrayList. That makes the app larger than it 
 should. Luckily the List interface does not have that much implementations 
 and overhead isn't that much but it is still something to be aware of, 
 especially if you use lots of libraries that might have additional List 
 implementations.

 GWT-RPC generates a file of the form hash.gwt.rpc in your output folder 
 which contains all classes that GWT-RPC has detected and generated 
 serializers for. It is handy to look into that file from time to time to 
 check if lots of unwanted things are detected. Also the GWT compile report 
 gives you insight about the final JavaScript size of serializers.

 4.) From a user perspective you should make sure to have some loading 
 indicator while the table data loads in case the network is slow.


 -- 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: Synchronized code after a service call

2015-05-02 Thread Jens
I see. You can still send the whole list to the server and check all dbs at 
once instead of one-by-one like you do now with a for-loop.

-- 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: GWT 2.7.0 DevMode not allowing multiple GWT Modules

2015-05-02 Thread tbb
Thanks Thomas.

I might give that a try, but even if it worked, it would still be a pretty 
clunky. Anyway chance that could be easily fixed?

Right now, I'm leaning towards a second Maven module - using the 
buildhelper plugin to mirror the source paths of the other module in...

On Saturday, May 2, 2015 at 6:02:05 PM UTC+8, Thomas Broyer wrote:

 IIRC this could be due to a cache expiration in the mapping from module 
 short names (e.g. portal) to their fully-qualified name (e.g. 
 com.xyz.ModuleB).
 One workaround *could* be to load both modules fast enough after DevMode 
 startup that the mapping is not reclaimed.

 On Saturday, May 2, 2015 at 10:04:25 AM UTC+2, tbb wrote:

 I've migrated a Maven based GWT project from GWT 2.5 to 2.7. The project 
 has 2 GWT Modules (.gwt.xml) within one Maven project. In GWT 2.5 I was 
 able to start DevMode and point the browser to the host page of either 
 module and all worked fine.

 My POM looked like this:

 runTarget${gwt.hostPageModuleA}/runTarget
 modules
 modulecom.xyz.ModuleA/module
 modulecom.xyz.ModuleB/module
 /modules

 Now with GWT 2.7 (still using classic DevMode), DevMode only works for 
 the module which has its hostPage configured as runTarget. If I switch the 
 hostPage to moduleB, moduleB works.

 If I'm accessing the module which is not matching the runTarget, I'm 
 getting this error message:

 00:01:19.009 [ERROR] Unable to find 'portal.gwt.xml' on your classpath; 
 could be a typo, or maybe you forgot to include a classpath entry for source?

 Once the runTarget points to the right host page (i.e. restart with a 
 different profile), it works fine.

 Rather cumbersome for me as I'm working on both GWT modules at the same 
 time - I now have to stop DevMode, select another Maven profile which 
 adjusts the hostPage and then start again.

 How can I make that work with GWT 2.7 (and not switch to SuperDevMode)?

 TIA

 Thomas



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