Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6934007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:54:19+00:00 2026-05-27T11:54:19+00:00

I have a task to add a composite widget into the main ui.xml file,

  • 0

I have a task to add a composite widget into the main ui.xml file, but it’s not working for some reason. Here is my widget code:

public class MyClass extends Composite {
    @UiTemplate("MyClass .ui.xml")
    interface MyClassUiBinder extends UiBinder<Widget, MyClass > {
    }

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

    @UiField Label label;

    public MyClass() {
        initWidget(uiBinder.createAndBindUi(this));
    } ...

Then in my main viewImpl.ui.xml class:
I declare the class package:

 ... xmlns:u="urn:com... client.view">

and then the widget itself:

<g:HTMLPanel ui:field="mainPanel" styleName="{style.mainPanel}">
<table align="center">
<tr>
    <td align="center">
        <u:MyClass/>
    </td>
</tr>

I also tried setting up a ui:field declaration in the viewImpl class, but I got an error thrown at compile time:

ERROR] In @UiField myClass, template field and owner field types don’t match: com.google.gwt.dom.client.Element is not assignable to com… client.view.MyClass

When I took the @UiField declaration out of the viewImpl and the ui.xml it compiled, but the widget wasn’t displaying when the page loaded.

I created another composite widget class and tried to duplicate this with just a button widget.

Using firebug I see that the element has been added to the main ui.xml page, but it also is not displaying, so my binding isn’t totally complete somehow.

What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:54:19+00:00Added an answer on May 27, 2026 at 11:54 am

    I found the problem, GWT was telling me that I didn’t do my declaration properly, but the error wasn’t as descriptive as I would have liked.

    In the main.ui.xml file I used:

    <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
     xmlns:g="urn:import:com.google.gwt.user.client.ui"
     xmlns:u="urn:com.abc.client.view">
    

    However, the last line should have had the word import in it:

    xmlns:u="urn:import.com.abc.client.view">
    

    This is where I found the answer.

    I hope this helps someone, this cost me a lot of time!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple task: add the contents of a textField to an
I have recently been given a task to add the ability to interact with
I have a task and I want to generate some code using the CodeDom.
I have a task of parsing a simple XML-formatted string in a MySQL stored
I have a task - add round corners to HtmlPanelGrid. Now I am trying
I have a task that returns a value, but I want to convert that
My Task have multiple relateddocId for example RelatedDoc=3,5,2,6, now i need to add multiplevalue
I have the unfortunate task of having to import data from excel into a
I have this code: Dim Tasks As New List(Of Task) Tasks.Add(Task.Factory.StartNew(Sub() 'Do whatever End
I have some task in my script that is about converting video with ffmpeg

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.