Glad that you found the error. I would like to add something to this post which may not be directly related to your problem but is something worth mentioning if you are going to use DOM.
Doing DOM parsing while using custom GWT widgets can cause major problems in the future. I see that you are doing getElementById which is pretty basic stuff and it shields you from parsing family heirarchy. But if at all you are thinking of doing getParent and getLastChild or get nth child and then getting/setting params, trouble awaits you with arms wide open. Because to do that level of DOM parsing you need to know the HTML structure of the doc and custom widgets have their own internal structure which the user should not fiddle with. Today your widget may be an image within a div. But tomorrow when you upgrade to a new GWT version, there might be a table injected between your image and the parent div. That would launch some dirty pyrotechnics in your app. Plus DOM parsing is pretty quirky in IE as it is pretty strict in what it does and doesn't. And it strict not in a good way of implementing standards but strict in a pain-in-the-wrong- place way. On Jan 27, 1:12 am, SoMa <[email protected]> wrote: > I found a mistake in my code: > I try to call my static setFullname method before call RootPanel.get > (...).add(...). :) > > Now, in my test web application I use this code: > > HeaderPage headerPage = new HeaderPage(); > ... > RootPanel.get("myapp-frame-header").add(headerPage); > SystemUtils.setHeaderFullname("dddddkkdkd faszomm"); > SystemUtils.setHeaderCompanyname("kaka"); > > It is working! > > I have made I simple LoginPage composite class with follow content: > public class LoginPage extends Composite > { > private HorizontalPanel mainPanel = new HorizontalPanel(); > > private final Label label = new Label("Hello, GWT!!!"); > private final Button button = new Button("Click me!"); > > public void render() > { > button.addClickListener(new ClickListener() > { > public void onClick(Widget w) > { > SystemUtils.setHeaderFullname("KissMiska"); > SystemUtils.setHeaderCompanyname("faszom Kft."); > label.setVisible( !label.isVisible() ); > } > }); > > mainPanel.add(label); > mainPanel.add(button); > > // all composites must call initWidget() in their constructors > initWidget(mainPanel); > } > > And my MyAppEntryPoint.java: > { > // show header of web application > HeaderPage headerPage = new HeaderPage(language); > headerPage.render(); > > // show navigation bar > ... > > // show page content > LoginPage loginPage = new LoginPage(language); > loginPage.render(); > > RootPanel.get("myapp-frame-header").add(headerPage); > RootPanel.get("myapp-frame-main").add(loginPage); > > } > > And it is working too! > > Thank you for your help! > > regards, Arnold --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
