gessleper / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

GWTCanvas: cannot run wiki's examples. #196

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of gwt and gwt-incubator are you using?

gwt-incubator_1-5_Sept_04

What OS and browser are you using?

Ubuntu 8.10 32Bit

Firefox 3.

Do you see this error in hosted mode, web mode, or both?

Hosted Mode

(If possible, please include a test case that shows the problem)

Hopefully using the test case you have generously provided, what steps will
reproduce the problem? 
1.
2.
3.

What is the expected output? What do you see instead?

Workaround if you have one:

Please provide any additional information below,  and thank you for taking
the time and effort to report this issue, as good issue reports are
critical for our quest to make GWT's new widgets and libraries shine.

While trying to run the first example code I get this error

Stacktrace

[ERROR] Unable to load module entry point class
it.unibz.inf.wobda.client.WOBDA (see associated exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError): e.getContext
is not a function  fileName:
jar:file:/home/giorgio/gwt-incubator_1-5_Sept_04/gwt-incubator.jar!/com/google/g
wt/widgetideas/graphics/client/impl/GWTCanvasImplDefault.java
 lineNumber: 51  stack:
()@jar:file:/home/giorgio/gwt-incubator_1-5_Sept_04/gwt-incubator.jar!/com/googl
e/gwt/widgetideas/graphics/client/impl/GWTCanvasImplDefault.java:51
gwtOnLoad([object Window],"it.unibz.inf.wobda.WOBDA","1.5")@:0
gwtOnLoad((function () {alert("Failed to load module
it.unibz.inf.wobda.WOBDA\".\nPlease see the log in the development shell
for
details.");}),"it.unibz.inf.wobda.WOBDA","http://localhost:8888/it.unibz.inf.wob
da.WOBDA/")@http://localhost:8888/it.unibz.inf.wobda.WOBDA/hosted.html?it_unibz_
inf_wobda_WOBDA:20
maybeStartModule()@http://localhost:8888/it.unibz.inf.wobda.WOBDA/it.unibz.inf.w
obda.WOBDA.nocache.js:100
()@http://localhost:8888/it.unibz.inf.wobda.WOBDA/it.unibz.inf.wobda.WOBDA.nocac
he.js:354
@http://localhost:8888/it.unibz.inf.wobda.WOBDA/hosted.html?it_unibz_inf_wobda_W
OBDA:39
    at
com.google.gwt.widgetideas.graphics.client.impl.GWTCanvasImplDefault.createEleme
nt(Native
Method)     at
com.google.gwt.widgetideas.graphics.client.GWTCanvas.<init>(GWTCanvas.java:121)
    at it.unibz.inf.wobda.client.WOBDA.onModuleLoad(WOBDA.java:18)

Original issue reported on code.google.com by giorgio....@gmail.com on 22 Nov 2008 at 11:11

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ecc%google.com@gtempaccount.com on 1 Dec 2008 at 5:44

GoogleCodeExporter commented 8 years ago
Unfortunately GWTCanvas will only work in hosted mode on Mac OS X and on 
windows. This has to do with the 
underlying version of the hosted mode browsers. Linux hosted mode runs an older 
version of mozilla that does 
not support canvas or VML. We are working on some cool stuff that will totally 
eliminate this problem on all 
platforms.

There is some workarounds that you can do for now. Compiled Web mode versions 
should work on all platforms 
:).

Original comment by jaime...@google.com on 1 Dec 2008 at 6:15

GoogleCodeExporter commented 8 years ago

Original comment by jaime...@google.com on 1 Dec 2008 at 6:16

GoogleCodeExporter commented 8 years ago
In this case, does anyone have advice on configuring Eclipse for 
developing/testing
in Compiled Web mode?

Original comment by ayt...@gmail.com on 19 Jan 2009 at 2:26

GoogleCodeExporter commented 8 years ago

Original comment by jaime...@google.com on 2 Mar 2009 at 4:35

GoogleCodeExporter commented 8 years ago
what are the workarounds to make incubator work in ubuntu?
I have the same problem and cannot use GWTcanvas.

Original comment by ufreeurself on 11 Mar 2009 at 4:32

GoogleCodeExporter commented 8 years ago
Compiled Web mode does not work for me either. It compiles, but I get a blank 
page.

Original comment by ufreeurself on 11 Mar 2009 at 4:36

GoogleCodeExporter commented 8 years ago

I have tried with both gwt-linux-1.5.3 and gwt-linux-1.6.1

Original comment by ufreeurself on 11 Mar 2009 at 5:27

GoogleCodeExporter commented 8 years ago
What browser are you running? Compiled web mode should work in FF3 on ubuntu. 
Can you point your 
browser at the demos here:
http://google-web-toolkit-
incubator.googlecode.com/svn/trunk/demo/GWTCanvasDemo/GWTCanvasDemo.html

There are changes coming in the near future that should be a complete ideal 
solution for this, in the form of 
OOPHM (Out Of Process Hosted Mode) which will let you debug in eclipse viewing 
the app in an actual real 
browser. But for now, compiling to webmode is what you have to do on linux.

Original comment by jaime...@gmail.com on 11 Mar 2009 at 5:33

GoogleCodeExporter commented 8 years ago
My browser is Firefox 3.0.7.
For the now I know that I can use GWTCanvas in Web Mode if I stick it to the 
RootPanel:
RootPanel.get().add(canvas);
I have successfully drawn the clock in the demo you indicated to me.
However, if I try to put the canvas into another kind of widget it breaks.

I have tried to put the canvas into a cell of a FlexTable:
FlexTable controlTable = new FlexTable();
.....
this.controlTable.setWidget(2, 1, canvas);
I did not succeed

Also, I have tried inserting the canvas into a CustomControl declared in 
com.google.gwt.maps.client.control.Control.CustomControl (googleMaps)
I did not succeed

what do you think is not working correctly? can I use the canvas in one of 
these ways?

The graphics library could be one of the most useful for us, thank you for the
efforts you are making to improve it.

Original comment by ufreeurself on 12 Mar 2009 at 5:25

GoogleCodeExporter commented 8 years ago
Is your FlexTable attached to the page?

The following code works for me on linux FF2/3:

 public void onModuleLoad() {
    GWTCanvas canvas = new GWTCanvas();
    FlexTable table = new FlexTable();
    RootPanel.get().add(table);

    table.insertRow(0);
    table.insertCell(0, 0);
    table.setWidget(0, 0, canvas);  
    canvas.fillRect(0, 0, 20, 30);

    canvas = new GWTCanvas();    
    table.insertRow(1);
    table.insertCell(1, 0);
    table.setWidget(1, 0, canvas);
    canvas.setFillStyle(Color.RED);
    canvas.fillRect(0, 0, 20, 30);
 }

Original comment by jaime...@google.com on 12 Mar 2009 at 6:20

GoogleCodeExporter commented 8 years ago
Yes, you are right, that works for me too,
If someone reads this, I think my mistake was similar to this:

 public void onModuleLoad() {
    GWTCanvas canvas = new GWTCanvas();
    FlexTable table = new FlexTable();
    RootPanel.get().add(table);

    table.insertRow(0);
    table.insertCell(0, 0);
    table.setWidget(0, 0, canvas);  
    canvas.fillRect(0, 0, 20, 30);

    /**canvas = new GWTCanvas();**/   
    table.insertRow(1);
    table.insertCell(1, 0);
    table.setWidget(1, 0, canvas);
    canvas.setFillStyle(Color.RED);
    canvas.fillRect(0, 0, 20, 30);
 }

so the first rectangle is not drawn.
I also solved the problem with googleMaps, I was too careless,
""Thank you""

Original comment by ufreeurself on 12 Mar 2009 at 11:15