> Can you please direct me to any such tutorial and or blog regarding
> this.
> Or may be a list of things that I should take care while migrating to
> declarative UI with the  programatic UI from the earlier version of
> GWT2.0

Suppose  MyWidget class  is in package "com.old.ui"    uibinder
template for  WidgetContainer  can look like this

<!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:oldWidgets="urn:import:com.old.ui">
<g:HTMLPanel>
                <h1>WidgetContainer</h1>
                        <div>bla bla </div

                        <div><oldWidgets:MyWidget
ui:field="widgetContainerFieldNameForOldWidget"
someOldWidgetProperty="haha" /></div>

</g:HTMLPanel>

</ui:UiBinder>

Notice xml namespace declaration:
xmlns:oldWidgets="urn:import:com.old.ui"

Important things to remember:
- MyWidget class must be accessible from WidgetContainer class so must
have  public or be in the same package and has default access.
- In this example MyWidget  has  setter:   " public void
setSomeOldWidgetProperty(String v)"
- MyWidget must have accessible noargs contructors or you have to
create factory method annotated with  @UIFactory  in WidgetContainer
or   add provided=true

@UiField(provided=true)
MyWidget widgetContainerFieldNameForOldWidget ;


and create instance of MyWidget in WidgetContainer

All informations you can found  here:
http://code.google.com/intl/pl/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_a_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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to