Re: [Error] This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement()
Hi Shravan, Can you paste the changes you did. I am also getting the same issue. On Tuesday, June 3, 2008 5:49:31 PM UTC+5:30, Shravan కుమార్ *-*-0-*-* wrote: Thanks all, I got the solution. I was trying to pass params in the constructor it self, hence the problem. I have created the object with default constructor and initialized with initWidget and updated the object with proper constructor. Now its working fine. On Tue, Jun 3, 2008 at 5:14 PM, Ian Bambury ianba...@gmail.comjavascript: wrote: Here's a little example: class DisplayBox extends Composite { public DisplayBox(String header, String data) { VerticalPanel widget = new VerticalPanel(); initWidget(widget); widget.addStyleName(demo-Composite); Label headerText = new Label(header); widget.add(headerText); headerText.addStyleName(demo-Composite-header); Label dataText = new Label(data); widget.add(dataText); dataText.addStyleName(demo-Composite-data); } } -- Ian http://examples.roughian.com __ Stuff the environment - print this email __ -- 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: Error This UIObject's element is not set;
Hi Shi! create a constructor for your MenuHome and move the code from the Composite()- Method into this constructor. Extending from Composite is correct! ^^ Don't know why you use a method for doing this... ;) ... public MenuHome() { VerticalPanel vPanel = new VerticalPanel(); // Do You really want to set the title (title = tooltip)? // To see something create a Label with Text an add this to the vPanel // Example // Label label = new Label(Good!); // vPanel.add(label); vPanel.setTitle(GOOD!); vPanel.setWidth(100%); vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); initWidget(vPanel); // Don't use this here (you do this on your entrypoint alright) RootPanel.get().add(vPanel); } I hope i could help you... ;) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Error This UIObject's element is not set;
Hi, I'm trying to compose the widget, but I get the same mistake.I simplified the code of 2 modules that I consider: - import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Composite; public class MenuHome extends Composite { public void Composite() { VerticalPanel vPanel = new VerticalPanel(); vPanel.setTitle(GOOD!); vPanel.setWidth(100%); vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); initWidget(vPanel); RootPanel.get().add(vPanel);} } - import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.Window; public class Home implements EntryPoint { private MenuHome menuhome; public void onModuleLoad() { Window.setTitle(Title); menuhome = new MenuHome(); RootPanel.get().add(menuhome); } } -- MenuHome.gwt.xml module inherits name='com.google.gwt.user.User'/ entry-point class='com.gwt.client.MenuHome'/ stylesheet src='MenuHome.css' / /module - Home.gwt.xml module inherits name='com.google.gwt.user.User'/ inherits name='com.google.gwt.user.theme.standard.Standard'/ entry-point class='com.gwt.client.Home'/ stylesheet src='Home.css' / /module -- MenuHome.html html head meta http-equiv=content-type content=text/html; charset=UTF-8 titleMenuHome/title script type=text/javascript language=javascript src=com.gwt.MenuHome.nocache.js/script /head body iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1' style=position:absolute;width:0;height:0;border:0/iframe /body /html - Home.html html head meta http-equiv=content-type content=text/html; charset=UTF-8 titleHome/title script type=text/javascript language=javascript src=com.gwt.Home.nocache.js/script /head body iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1' style=position:absolute;width:0;height:0;border:0/iframe /body /html -- ERROR: [ERROR] Unable to load module entry point class com.gwt.client.Home (see associated exception for details) java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement() at com.google.gwt.user.client.ui.UIObject.getElement(UIObject.java: 511) at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java: 83) at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java: 80) at com.gwt.client.Home.onModuleLoad(Home.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:320) at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java: 329) at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access $100(BrowserWidgetMoz.java:35) at com.google.gwt.dev.shell.moz.BrowserWidgetMoz $ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:59) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java: 1428) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840) at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720) at com.google.gwt.dev.GWTShell.run(GWTShell.java:593) at com.google.gwt.dev.GWTShell.main(GWTShell.java:357) someone knows the problem?thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---