BorderLayout test doesn't work

19 views
Skip to first unread message

alona.oz

unread,
Sep 1, 2010, 4:58:31 AM9/1/10
to gwt-mosaic
I tried to play a little with this library and copied the following
example from showcase examples.
But when I run it, it looks different and doesn’t seem to be as the
example. The buttons are not placed by regions, they placed as one
horizontal stack.

What I miss here?

10x

public class Hello implements EntryPoint {

public void onModuleLoad() {


LayoutPanel layoutPanel = new LayoutPanel(new BorderLayout());
final Button b1 = new Button("NORTH");
final Button b2 = new Button("SOUTH");
final Button b3 = new Button("WEST");
final Button b4 = new Button("EAST");
final Button b5 = new Button("CENTER");

layoutPanel.add(b1, new
BorderLayoutData(BorderLayout.Region.NORTH,"10", "200"));

layoutPanel.add(b3, new
BorderLayoutData(BorderLayout.Region.WEST, "10", "200"));
layoutPanel.add(b4, new
BorderLayoutData(BorderLayout.Region.EAST, "10", "200"));
layoutPanel.add(b5, new
BorderLayoutData(BorderLayout.Region.CENTER, true));
layoutPanel.add(b2, new
BorderLayoutData(BorderLayout.Region.SOUTH, "10", "200"));

layoutPanel.setWidth("100%");
layoutPanel.setHeight("100%");

RootPanel.get().add(layoutPanel);
}


}

Nico

unread,
Sep 3, 2010, 9:36:05 AM9/3/10
to gwt-mosaic
Hello,

You must layoutPanel.layout(); before
RootPanel.get().add(layoutPanel);

alona.oz

unread,
Sep 6, 2010, 4:40:53 AM9/6/10
to gwt-mosaic
I've added this line, but still the same...
I suspect it's related to broswer version or type.
I used IE 8, now I tried to run it it Chrome and I received the
follwoing exception in GWT console:

00:00:15.393 [ERROR] Unable to load module entry point class
com.allen_sauer.gwt.dnd.client.util.DragEntryPoint (see associated
exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError): Object
[object HTMLDocument] has no method 'createStyleSheet' stack:
TypeError: Object [object HTMLDocument] has no method
'createStyleSheet' at [object Object].<anonymous> (unknown
source) at __gwt_jsInvoke (http://127.0.0.1:8888/com.hp.Hello/
hosted.html?com_hp_Hello:70:35) at
http://127.0.0.1:8888/com.hp.Hello/hosted.html?com_hp_Hello:263:16
at z (http://127.0.0.1:8888/com.hp.Hello/com.hp.Hello.nocache.js:
2:144) at http://127.0.0.1:8888/com.hp.Hello/com.hp.Hello.nocache.js:9:140
type: undefined_method

May it be related?

10x
> >     }}- Hide quoted text -
>
> - Show quoted text -

Nico

unread,
Sep 6, 2010, 8:24:11 AM9/6/10
to gwt-mosaic
Your exception is about the drag and drop library but your code
doesn't need it to work.
Maybe should you modify your .gwt.xml file.

I just added the following lines to mine .gwt.xml file and the code is
OK :

<!-- Modules Mosaic -->
<inherits name='org.gwt.mosaic.Mosaic' />
<inherits name='org.gwt.mosaic.actions.Actions' />
<inherits name='org.gwt.mosaic.forms.Forms' />

On 6 sep, 10:40, "alona.oz" <alona.my...@gmail.com> wrote:
> I've added this line, but still the same...
> I suspect it's related to broswer version or type.
> I used IE 8, now I tried to run it it Chrome and I received the
> follwoing exception in GWT console:
>
> 00:00:15.393 [ERROR] Unable to load module entry point class
> com.allen_sauer.gwt.dnd.client.util.DragEntryPoint (see associated
> exception for details)
> com.google.gwt.core.client.JavaScriptException: (TypeError): Object
> [object HTMLDocument] has no method 'createStyleSheet'  stack:
> TypeError: Object [object HTMLDocument] has no method
> 'createStyleSheet'     at [object Object].<anonymous> (unknown
> source)     at __gwt_jsInvoke (http://127.0.0.1:8888/com.hp.Hello/
> hosted.html?com_hp_Hello:70:35)     athttp://127.0.0.1:8888/com.hp.Hello/hosted.html?com_hp_Hello:263:16
> 2:144)     athttp://127.0.0.1:8888/com.hp.Hello/com.hp.Hello.nocache.js:9:140
Reply all
Reply to author
Forward
0 new messages