Jason Essington wrote:
>Are you developing / testing on IE?
I am a developer and usually I use Mozilla Firefox.
> I think that you can only create
> (set) the id of an element the moment it is created.
>
> At any rate, I think you are going about your task all wrong anyway.
> If you are doing any manual DOM manipulation of Widgets that you have
> created (Labels in this case) then you are probably on the wrong
> path ...
I do not manipulate the DOM tree directly. I prepare Label widget on
the usual manner:
Label fullnameLabel = new Label();
fullnameLabel.setStyleName("mywebapp-font-h1-bold-white");
fullnameLabel.getElement().setId("headerPage_fullnameLabel");
fullnameLabel.setWidth("300px");
fullnameLabel.setHorizontalAlignment
(HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.add(fullnameLabel);
> in your case since you already have label widgets, simply call
> setText() on the widget itself ... your HeaderPage class can simply
> have a setFullName() and setCompanyName() method
Yes, now I use this solution :) (setXxx() method) but I think It is
not smart solution because I need to pass a reference from parent
class (LoginPage in my example) to my all another composite class
where I intend to set content of label. I think smarter to use the
follow solution instead of reference passing:
public class SystemUtils
{
public static void setInnerText(String id, String caption)
{
Document.get().getElementById(id).setInnerText(caption);
}
public static void setHeaderFullname(String fullName)
{
setInnerText("oxigen-frame-header", fullName);
}
}
I think, I can use these methods anywhere without reference to the
parent composite class. But there is a restriction: I need to create
the widget before call SystemUtils.setInnerText() method. In my case
the label was created (in MyAppEntryPoint.java) before call it.
What do you think, this solution can work?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---