Hi,

I'm trying to create a number of reusable dialog boxes using
UiBinder.  Basically, I want to be able to call...

void someFn()
{
        MyDialogBox box = new MyDialogBox(myConfigObj);
        box.show();
}

... but I want to define the Dialog in its Own MyDialogBox.ui.xml &
MyDialogBox.java files and the above code could be called in a number
of places.

So far I have:

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

        <ui:style>
                ...
        </ui:style>

        <g:DialogBox autoHide="true" modal="true" glassEnabled="true">
                <g:caption>
                        <b>title</b>
                </g:caption>
                <g:DockLayoutPanel unit="PX" width="700px" height="450px">
                        ...
                </g:DockLayoutPanel>
        </g:DialogBox>
</ui:UiBinder>

... and ...

public class MyDialogBox extends DialogBox
{

        private static MyDialogBoxUiBinder uiBinder =
GWT.create(MyDialogBoxUiBinder.class);

        interface MyDialogBoxUiBinder extends UiBinder<Widget, MyDialogBox>
        {
        }

        public MyDialogBox()
        {
                uiBinder.createAndBindUi(this);
        }

        @UiFactory
        DialogBox thatsJustMe()
        {
                return this;
        }

}

This seems... wrong?  Is there a better way??  I can't control the
dialog size with setWidth/Height.. it screws up royally.

Is there a tutorial?

And I DO NOT want to embed the dialog box in another UiBinder file as
I see all over the place.. its not reusable. (as in:
http://h2g2java.blessedgeek.com/2010/02/tutorial-gwt-rpc-stub-modified-with.html)

The closest example (used above) i can find is:
http://www.mail-archive.com/[email protected]/msg36101.html

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

Reply via email to