Using <g:Anchor> and <g:FlowPanel> is what I tried first, but I got
the following error:
19:15:00.173 [ERROR] [gwtui] Found widget <g:FlowPanel
ui:field='contentArea'> in an HTML context
I guess that you are telling me the UiBinder just doesn't do what I
thought it did which is to allow look-and-feel of the UI for GWT apps
to be developed by people (and tools) who know HTML/CSS but not GWT.
So where I use UiBinder, either I need to start at the top of my
ui.xml file and replace all <table>s and <div>s with <g:XxxxPanel>s or
I need to give up on using Widgets and make calls to
myElement.setInnerHtml()? That's disappointing.
RootPanel.get("someId") works, right? And I call this multiple times,
so I could put most of my HTML into the base Project.html file. That
sounds kludgy, but might be my best option at this point.
I'm not doubting you, but what about "Anchor.wrap(logoutLink)" won't
work? If this is not the right way to use that method, what is?
Eric
On Feb 2, 6:04 am, Thomas Broyer <[email protected]> wrote:
> On Feb 2, 2:33 am, Eric <[email protected]> wrote:
>
>
>
>
>
> > Hello all,
>
> > I hope this is obvious and I'm just missing it, but I can't figure out
> > how to add a Widget to a DivElement or TableCellElement that I get
> > back from my uiBinder template. Here is what I have:
>
> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" >
> > <div class="wrapper">
>
> > [lots of eye candy that came from a graphic designer]
>
> > <a ui:field="logoutLink">Logout</a>
> > [more html]
>
> > <div ui:field="contentArea" />
>
> > [lots more stuff]
>
> > </div>
> > </ui:UiBinder>
>
> > then in Java:
> > @UiField
> > LinkElement logoutLink;
> > @UiField
> > DivElement contentArea;
>
> > public HasClickHandlers getLogoutLink() {
> > // This was easy
> > return Anchor.wrap(logoutLink);
> > }
>
> Won't work (or at least shouldn't, and might cause issues later on).
> Why don't you use a <g:Anchor ui:field='logoutLink'>Logout</g:Anchor>
> in your ui.xml?
>
> > public HasWidgets getContentArea() {
> > // I can't figure out what to put here. Help! Please!
> > return null;
> > }
>
> > How do I turn an Element into some kind of Panel? Or add a Widget to
> > a container Element?
>
> Either use a "true" container, such as <g:FlowPanel
> ui:field='contentArea' />, or go the hard way and manage the onAttach/
> onDetach of the added/removed child widgets yourself (which means
> implementing HasWidgets yourself too).
--
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.