Did you specify where to look for the classes in the "*my*" namespace?
There should be a line at the top of your new xml.ui file, which says
something like:
  xmlns:*my*='urn:import:com.example.project.client'>

You can check the GWT mail example, in the following file it uses Mailboxes,
Tasks, and Contacts classes which are defined in other xml files.
http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/mail/src/com/google/gwt/sample/mail/client/Shortcuts.ui.xml?r=6192

hope it helps,

On Mon, Oct 25, 2010 at 8:41 PM, mars <[email protected]> wrote:

> hi,
>
> I need to create a class, myBox,  to extends HTMLPanel so that i can
> add content to it. here is my code:
>
> ui.xml:
> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
>     xmlns:g="urn:import:com.google.gwt.user.client.ui">
>
>    <g:HTMLPanel styleName="FormsBox">
>      <div class="FormsTop">&nbsp;</div>
>      <g:HTMLPanel styleName="FormsContent">
>         <g:HTMLPanel ui:field="_contentPanel"></g:HTMLPanel>
>      </g:HTMLPanel>
>        <div class="FormsBtm">&nbsp;</div>
>    </g:HTMLPanel>
> </ui:UiBinder>
>
>
> .java:
> public class MyBox extends Composite {
>
>    /**
>     * The UiBinder interface.
>     */
>    interface Binder extends UiBinder<HTMLPanel, MyBox> {
>    }
>
>    @UiField
>    HTMLPanel _contentPanel;
>
>    /**
>     * The UiBinder instance.
>     */
>    private static final Binder BINDER = GWT.create(Binder.class);
>
>    public MyBox() {
>        HTMLPanel rootElement = BINDER.createAndBindUi(this);
>        this.initWidget(rootElement);
>
>        rootElement.add(_contentPanel);
>        }
>
> }
>
>
> Then I tried to use MyBox in another ui.xml like the below:
>
> ...
> <my:MyBox ui:field="_myfield">
>  <h2>my box!</h2>
> </my:MyBox>
> ...
>
> gwt complained:
> [ERROR] Unexpected text in <my:MyBox ui:field="_myfield"><h2>my box!</
> h2>
>
> anyone know how to fix this?  Thanks!
>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

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