Re: Anchor does not work in IE - very strange problem!

2013-06-25 Thread Magnus
Hello,

the advice to use an UncaughtExceptionHandler was very helpful for solving 
this acutal problem.

But it also has a disadvantage: It brings to light new problems! :-)

But because it would be offtopic here I have started another thread:

CellTable - TextColumn.getValue (null) - another strange 
problem

Magnus

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




CellTable - TextColumn.getValue (null) - another strange problem

2013-06-25 Thread Magnus
Hello,

after setting an UncaughtExceptionHandler with 
GWT.setUncaughtExceptionHandler() 
for the first time, I see a new NullPointerException that I did not see 
before and which did not cause any visible problems.

The exception occurrs, because the getValue methods of the table's columns 
are called with a null value, e. g.:

--
--
  TextColumn col_Start = new TextColumn()
  {
   @Override
   public String getValue(Game obj)
   {
return (obj.str_Start); // exception, obj is null!
   }
  };
--
--

As said above, there seem to be no consequences. The table's contents seem 
to be ok. Also, when I check for null values and return "???" instead, the 
"???" will not appear in the table.
Nevertheless, I do not want to ignore it. Since the getValue methods are 
called by the GWT framework, I believe that there must be a problem with my 
own code (rather than a bug in GWT).

It onlly happens, when I navigate from the second page back to the first 
one, so I assume a problem within the onRangeChange callback method.

However, I have outsourced most of the CellTable handling into a seperate 
class CellListController (see below). So if there was a problem with my 
code, it would most likely be located there.
But I really don't know where to start, because I cannot imagine any reason 
why the framework should call my methods with null values?

Any ideas?

Thank you
Magnus

--
--

public class CellListController
{
 public CellListCarrier   crr = null;
 public CellTable  tbl = null;
 public AsyncDataProvider  pvd = null;
 public Pager pgr = null;
 
 // Construction

 public CellListController ()
 {
  super ();
 }
 
 public CellListController (CellListCarrier crr)
 {
  setCarrier (crr);
 }

 // Component Creation
 
 public void createAll (Pager pgr,int pageSize)
 {
  createTable();
  setPageSize (pageSize);
  createProvider();
  setPager(pgr);
 }
 
 public void createTable ()
 {
  CellTable t = new CellTable ();
  setTable (t);
 }
 
 public void createProvider ()
 {
  pvd = new AsyncDataProvider()
  {
   @Override
   protected void onRangeChanged(HasData display)
   {
Range r = display.getVisibleRange();
int start = r.getStart() + 1;
int end = start + r.getLength() - 1;

onRangeChange (start,end);
   }
  };
 }
 
// Settings
 public void setCarrier (CellListCarrier crr)
 {
  this.crr = crr;
 }
 
 public void setTable (CellTable tbl)
 {
  this.tbl = tbl;
  tbl.setPageStart (0);
 }
 
 public void setPager (Pager pgr)
 {
  this.pgr = pgr;
  pgr.setDisplay(tbl);
  pgr.setRangeLimited(true);
 }
 
 public void setPageSize (int pageSize)
 {
  tbl.setPageSize (pageSize);
 }
 
 public int getStart ()
 {
  Range r = pgr.getDisplay().getVisibleRange();
  int start = r.getStart();

  return (start);
 }
 
// Data
 public void load ()
 {
  pvd.addDataDisplay(tbl);
 }
 
 public void reload ()
 {
  Range r = tbl.getVisibleRange();
  reload (r);
 }
 
 public void reload (Range r)
 {
  tbl.setVisibleRangeAndClearData (r,true);

  if (!isLoaded ())
   load ();
 }
 
 public void reloadLast ()
 {
  int n = tbl.getRowCount();
  
  Range r = getLastRange (n);
  
  reload (r);
 }
 
 public void reloadFirst ()
 {
  int p = tbl.getPageSize();
  Range r = new Range (0,p);
  reload (r);
 }

 public Range getLastRange (int cnt)
 {
  int p = tbl.getPageSize();
  int s = cnt - p;
  
  if (s < 0)
   s = 0;
  
  Range r = new Range (s,p);

  return (r);
 }
 
 public void scheduleReload ()
 {
  Scheduler.get().scheduleDeferred
  (
   new ScheduledCommand()
   {
@Override
public void execute()
{
 reloadFirst ();
}
   }
  );
 }

// Callback Methods

 public void onRangeChange (int i0,int i1)
 {
  awi.log("CellListController.onRangeChange(" + i0 + "," + i1 + ")");
  
  crr.loadRecordList (i0,i1);
  crr.loadRecordCount ();
 }
 
 public void updateRowData (List lst)
 {
  if (lst == null)
   return;
  
  int start = getStart();

  pvd.updateRowData (start,lst);
 }

 public void updateRowCount (int cnt)
 {
  pvd.updateRowCount (cnt,true);
 }
 
 private boolean isLoaded ()
 {
  Set> s = pvd.getDataDisplays();
  
  if (s == null)
   return (false);
  
  if (s.isEmpty())
   return (false);
  
  return (true);
 }
}

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




Re: AstDumper is not giving consistent dumps

2013-06-25 Thread Ranjith Chungath
That was a problem with the text editor I used. It was not giving the right 
results on Searchmay be it was having problem due to the size of the 
file.
 
Once I changed the text editor to another one, I could see that the classes 
were getting printed 13 times consistently when the number of permutations 
was 1.
 
I later specified "-optimize 0" as compiler argument and it dumped the 
class only once, exactly what I was looking for.
 
Regards,
Ranjith

On Monday, June 24, 2013 10:54:24 PM UTC+5:30, Ranjith Chungath wrote:

> Hi,
>  
>   I am using the arrgument -Dgwt.jjs.dumpAst to dump the AST during GWT 
> compile.
>  
>   I am trying to understand which of the GWT modules we are using are 
> causing the AST to become larger.
>  
>   However, each time I run it with the same list of GWT modules, the dump 
> is different. I tried with running it with "-localWorkers 1" as argument to 
> the compiler so that I get consistent results, but still the ASTs are 
> different.
>  
>   For example,  the same class gets printed multiple times
> class A extends B{
> ...
> }
>  
> class A extends B{
> ...
> }
>  
> final class A extends B{
> ...
> }
>  
>   Sometimes it gets printed 3 times, sometimes 4 etc., not consistent. I 
> see that the last one is kind of optimized by removing some of the member 
> variables etc.
>  
>   How can I make the output consistent so that I can compare the dumps.
>  
> Thanks,
> Ranjith
>  
>

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




Re: Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host - while writing to the csv file

2013-06-25 Thread jhulford
It's because the browser is closing the connection, that's what the wrapped 
exception means.  The user is either hitting the stop button or navigating 
away or the file you're writing is taking way too long to write out and the 
browser (or a proxy along the way) is closing out the socket before 
everything is written.

You probably need to run this csv process in a background processing queue 
of some sort.

On Monday, June 24, 2013 3:43:40 PM UTC-5, Shashank Beerla wrote:
>
> Can anyone please suggest how to resolve this exception. I implemented a 
> code which writes huge data to the csv file. I don't know why the 
> connection is getting out.
>
>
>
> org.mortbay.jetty.EofException
> org.mortbay.jetty.EofException
> org.mortbay.jetty.HttpConnection$Output@f09f9a
> at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
> at 
> org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:566)
> at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:911)
> at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
> at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
> at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
> at java.io.BufferedWriter.flush(BufferedWriter.java:254)
> at 
> com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.writeCsv(CSVFileDownloadServlet.java:180)
> at 
> com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.doPost(CSVFileDownloadServlet.java:75)
> at 
> com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.doGet(CSVFileDownloadServlet.java:38)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
> at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at 
> org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
> at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
> at 
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
> at 
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
> Caused by: java.io.IOException: An existing connection was forcibly closed 
> by the remote host
> at sun.nio.ch.SocketDispatcher.write0(Native Method)
> at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
> at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)
> at sun.nio.ch.IOUtil.write(IOUtil.java:51)
> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
> at org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:160)
> at 
> org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:207)
> at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
> ... 28 more
>
>

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




Re: Barely clickable sorting labels in DataGrid

2013-06-25 Thread Thomas Broyer


On Tuesday, June 25, 2013 12:23:08 PM UTC+2, Luca Bellucci wrote:
>
> I was experiencing a problem with the DataGrid component, and I noticed it 
> happens in the Showcase as well, so I think it's general.
> I'm referring to this page: 
> http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwDataGrid
>
> If you try sorting by column, you can see this problem (see the image 
> attached):
> - The area I marked in Red, where most of the label is located, is NOT 
> clickable.
> - The area I marked in Green, slightly above the label, is normally 
> clickable and lets you sort the data.
>
> If you try the CellTable in the Showcase, instead, both the areas are 
> clickable and work fine.
>
> Note: if you click the "green" area, and proceed to sort the data by that 
> column value, THEN both the "green" and "red" areas of that column become 
> clickable and work fine. In that column only, anyway.
>

This has been fixed in 2.5.1: 
https://code.google.com/p/google-web-toolkit/issues/detail?id=7911 (and the 
Showcase hasn't been recompiled, it's from November, so 2.5.0 – or "trunk" 
from November)
 

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




Barely clickable sorting labels in DataGrid

2013-06-25 Thread Luca Bellucci
I was experiencing a problem with the DataGrid component, and I noticed it 
happens in the Showcase as well, so I think it's general.
I'm referring to this page: 
http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwDataGrid

If you try sorting by column, you can see this problem (see the image 
attached):
- The area I marked in Red, where most of the label is located, is NOT 
clickable.
- The area I marked in Green, slightly above the label, is normally 
clickable and lets you sort the data.

If you try the CellTable in the Showcase, instead, both the areas are 
clickable and work fine.

Note: if you click the "green" area, and proceed to sort the data by that 
column value, THEN both the "green" and "red" areas of that column become 
clickable and work fine. In that column only, anyway.

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


<>

Contribution: FlexTable with Model support

2013-06-25 Thread Maik Riechert
Hi guys,

Recently I stumbled upon the high-performance CellTable. In particular, I 
like its model-based approach compared to FlexTable's or Grid's 
't.setText(x,y,content)'. In my case, I don't care about performance 
(internal app) and I'd rather like to use all the Widget goodness that I'm 
used to. So, as a result, I added model support to FlexTable which then 
allows me to do the following:

ModelFlexTable table = new ModelFlexTable();

table.addColumn(new FlexColumn() {
@Override
public Widget createWidget(Model row) {
return new Label(row.getName());
}
}, "Name");

table.addColumn(new FlexColumn() {
@Override
public Widget createWidget(Model row) {
return new InlineHTML("");
}
}, "Color");

table.addColumn(new FlexColumn() {
@Override
public Widget createWidget(final Model row) {
Button remove = new Button("Remove");
remove.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
table.removeRow(row);
}
});
return remove;
}
});

table.addRow(new Model("red", "#ff"));
table.addRow(new Model("green", "#00ff00"));

where the Model class is:

public class Model {
private final String name;
private final String color;

public Model(String name, String color) {
this.name = name;
this.color = color;
}

public String getName() {
return name;
}

public String getColor() {
return color;
}
}


Maybe someone finds this useful. The downside is that the nice default 
styling of CellTable is missing, and other features of it like paging etc. 
So it's not a CellTable replacement but rather a nicer-to-use FlexTable if 
you have a model anyway.

Code is at https://gist.github.com/neothemachine/5857263

Cheers
Maik

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




Re: Anchor does not work in IE - very strange problem!

2013-06-25 Thread Jens


> but why was this exception not reported as others client-side exceptions 
> are?
>

In IE + DevMode you would have seen a NullPointerException on the console. 
If you use Chrome/Firefox + DevMode you never see the problem because both 
browser support the Audio element and thus its never null.

In DevMode, GWT automatically registers a DefaultUncaughtExceptionHandler 
that logs uncaught exceptions to the console. This only happens in DevMode 
and not if you have compiled your app. Thus if you dont have set your own 
UncaughtExceptionHandler in your app's onModuleLoad() you will never see 
uncaught exceptions once your app is compiled.

So always set an UncaughtExceptionHandler on your own and do what you want 
to do with that exception. For example I display an information message 
that something unexpected has happened and then send the exception to the 
server where it gets logged and a new issue is automatically created in an 
issue tracker.

-- 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/groups/opt_out.




Compiling a Java applet to JavaScript using GWT and a custom library

2013-06-25 Thread Bruno Bienfait
Hi,

I ported a molecular editor applet to JavaScript using GWT and a library 
that I developed: JSApplet. This library extends the JRE emulation for a 
subset of the Abstract Window Toolkit (events, windows, popumenu, 2D 
graphics, ...) and add new capabilities, such as HTML5 drag and drop, IOS 
and Android support. The original Java code of the applet required only 
minimal changes and it still can be used to generate a Java applet (jar 
file).
The capabilities and limitations of this library are described in my recent 
publication: http://www.jcheminf.com/content/5/1/24 .

My JavaScript "applet" can be seen in action 
here:http://www.molecular-networks.com/online_demos/corina_demo_interactive. 
The applet compiled with GWT is on left side (JSME). Interestingly, the one 
on the right side (JSmol), with 3D graphics, has been translated from Java 
using java2script (but not by me).


I have a question: is a library like JSApplet of general interest? Should I 
create an open source project?

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/groups/opt_out.