Monday, November 29, 2010

Re: Frustrated with GWT Binder

Paul,
Thank you very much

On Nov 27, 2:26 am, Paul Stockley <pstockl...@gmail.com> wrote:
> You need to add it to the RootLayoutPanel not the RootPanel.
>
> On Nov 26, 2:46 am,JeffZhang<zjf...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I'd like to create a UI like the sample application Mail. But I meet
> > some weird problems.
>
> > When I run the application, I can only see an empty page with nothing,
> > What's wrong with my code ?
>
> > The following is my sample code:
>
> > //  widget binder xml
>
> > <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
> >        xmlns:g="urn:import:com.google.gwt.user.client.ui"
> > xmlns:e="urn:import:zjffdu.tutorial.gwt.uibinder.client">
> >        <ui:style>
> >                .bolder {
> >                        font-weight: bolder;
> >                }
> >        </ui:style>
> >        <g:DockLayoutPanel unit="EM">
> >                <g:center size="40">
> >                        <g:Label text="my label"></g:Label>
> >                </g:center>
> >        </g:DockLayoutPanel>
>
> > </ui:UiBinder>
>
> > // binder java class
>
> > public class MyBinderWidget extends Composite {
>
> >        private static MyBinderWidgetUiBinder uiBinder = GWT
> >                        .create(MyBinderWidgetUiBinder.class);
>
> >        interface MyBinderWidgetUiBinder extends UiBinder<Widget,
> > MyBinderWidget> {
> >        }
>
> >        public MyBinderWidget() {
> >                initWidget(uiBinder.createAndBindUi(this));
>
> >        }
>
> > }
>
> > /**
> >  * Entry point classes define <code>onModuleLoad()</code>.
> >  */
> > public class UIBinderExample implements EntryPoint {
>
> >        /**
> >         * This is the entry point method.
> >         */
> >        public void onModuleLoad() {
> >                MyBinderWidget widget=new MyBinderWidget();
> >                RootPanel.get().add(widget);
> >        }
>
> > }

--
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