Unknown tag with, or is not appropriate as a top level element Element

204 views
Skip to first unread message

oerten25

unread,
Oct 8, 2011, 6:57:02 PM10/8/11
to Google Web Toolkit
Hello,

I couldn't manage to get ui:with working.

[ERROR] [com.myproject] - Unknown tag with, or is not appropriate as a
top level element Element <ui:with field='resource'
type='com.myproject.client.resource.MyResource'>

My ui.xml contents :

<!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:with type='com.myproject.client.resource.MyResource'
field='resource'></ui:with>
<ui:style>

.logo {
padding: 0 0 0 1em;
float:left;
height: 4.3em;
width: 13em;
}

.ss {
float:left;
padding:1.3em 0 0 1em;
text-decoration: underline;
font-weight: bold;

width:40%;
}
.aa{
clear:left;
width:100%;
background-color: #9CABBC;
min-height: 3em;

}


.eastPanel {
background-color: #F60;
}
.westPanel {
background-color: #F6F6F6;
}
.northPanel {
background-color: #F4F7FB;
}
.southPanel {
background-color: #F4F7FB;
}
.centerPanel {
background-color: transparent;
}

</ui:style>

<g:HTMLPanel>

<g:DockLayoutPanel unit='EM' height='100%'>
<g:north size='7'>
<g:FlowPanel styleName='{style.northPanel}'>
<g:Image ui:field='logo' addStyleNames='{style.logo}' />
<g:HTMLPanel styleName='{style.ss}'>Lorem Ipsum</g:HTMLPanel>
<g:FlowPanel styleName='{style.aa}'>
<g:HTMLPanel>
<ul addStyleNames="{resource.style.nav}">
<li> Homepage</li>
<li> Contacts</li>
<li> Help</li>

</ul>
</g:HTMLPanel>

</g:FlowPanel>
</g:FlowPanel>

</g:north>
<g:south size='5'>
<g:FlowPanel styleName='{style.southPanel}'>
<g:Label></g:Label>
</g:FlowPanel>
</g:south>
<g:west size='10'>
<g:FlowPanel styleName='{style.westPanel}'>
<g:Label></g:Label>
</g:FlowPanel>
</g:west>
<g:center>
<g:FlowPanel styleName='{style.centerPanel}' ui:field='center'>
<g:Label></g:Label>
</g:FlowPanel>
</g:center>


</g:DockLayoutPanel>

</g:HTMLPanel>

</ui:UiBinder>

My ClientBundle contents:

public interface MyResource extends ClientBundle {

public interface Style extends CssResource {
String nav();
}

@Source("/css/base.css")
Style style();

@Source("/img/logo.png")
ImageResource logo();


}

And my base.css contents :

.nav {
list-style-type: none;
}

I don't know what i'm missing but those should be enough according to
the documentation and many samples i've examined.
Please someone help me resolve this problem.

Thanks


oerten25

unread,
Oct 12, 2011, 2:53:56 PM10/12/11
to google-we...@googlegroups.com
any ideas? 

Thomas Broyer

unread,
Jan 11, 2013, 5:36:38 AM1/11/13
to google-we...@googlegroups.com


On Wednesday, January 9, 2013 2:01:39 PM UTC+1, Martin Pain wrote:
I know this problem was reported over a year ago, but I've just seen it, and have managed to diagnose what was causing it in my situation.

I've seen this problem when running GWT from Eclipse when my OS's locale is set to Turkey. (I believe it is caused by an incorrect case-insensitive compare in the parsing code somewhere.)

The workaround is to spell the element as ui:WITH, e.g.:
<ui:WITH type='com.myproject.client.resource.MyResource' field='resource' />

I hope this helps anyone else who runs into this problem.


Would you mind filing a new issue? (unless there's one already about it). We should do a pass over the whole codebase to remove all locale-sensitive toUpperCase/toLowerCase.

Feel free to provide a patch, it's always welcome!

Another workaround would be to switch locale: the GWT tools aren't localized anyway.
Reply all
Reply to author
Forward
0 new messages