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].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to