public void onModuleLoad() { MyPanel widget = new MyPanel(); widget.setHeight("50px"); RootPanel.get( "myappdiv").add(widget); } Alexandre
2012/7/23 Mike Dee <mdichiappari@gmail.com>
I've created a panel (AbsolutePanel) with a few widgets on it. They interact with one another (and with a backed via RPC).When I include the panel in a web page, nothing appears. Here's the code.// MyPanel.javapublic class MyPanel extends Composite{public MyPanel (){AbsolutePanel absolutePanel = new AbsolutePanel();initWidget(absolutePanel);Label helloLabel = new Label("Hello");absolutePanel.add( helloLabel , 10, 10);Label byeLabel = new Label("Goodbye");absolutePanel.add( byeLabel , 30, 10);}}// MyApp.javapublic class MyApp implements EntryPoint{/**
* This is the entry point method.*/public void onModuleLoad(){RootPanel.get( "myappdiv" ).add( new MyPanel() );}}// index.html<!DOCTYPE HTML><html><head><script type="text/javascript" src="myapp/myapp.nocache.js"></script></head><body"><div id="myappdiv"/></body></html>If I include just one widget (no AbsolutePanel) the widget appears.public class MyPanel extends Composite{public MyPanel (){Label helloLabel = new Label("Hello");initWidget( helloLabel );}}Are panels (for some reason) not allowed in cases like this? AbsolutePanel is (derived) from Widget, so it seems like it should work.--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/4sZcoLWYsHwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment