I am trying to do something quite simple, create a div based layout using uiBinder. At the centre of the layout are a couple of labels, some TextBoxes and an image. My desired output is:
____________________
Label 1 | box 1 |
--------------------
____________________
Label 2 | box 2 |
--------------------
_________
Label 3 | |
Label 4 | image |
---------
As the labels and the image are GWT widgets, I can't use div directly, so I am using FlowPanel instead. The documentation for FLowPanel indicates that it can contain widgets. However, when I compile the code below it throws the error
Not allowed in an HTML context: <g:Label addStyleNames='{res.css.actionPanelText}'> (:10)
Please, can someone point out where I am being dumb?
Thanks, Richard
<ui:with field='res' type='com.this.that.wf.portal.flip.client.ui.Resources' />
<FlowPanel>
<FlowPanel addStyleNames="{res.css.itemDetailsInput}">
<FlowPanel addStyleNames="{res.css.itemDetailsInputCol1}">
<g:Label>Label 1</g:Label>
<g:Label>Label 2</g:Label>
</FlowPanel>
<FlowPanel addStyleNames="{res.css.itemDetailsInputCol2}">
<g:TextBox ui:field="Box1"></g:TextBox>
<g:TextBox ui:field="Box2"></g:TextBox>
</FlowPanel>
</FlowPanel>
<FlowPanel addStyleNames="{res.css.itemDetailsOutput}">
<FlowPanel addStyleNames="{res.css.itemDetailsOutputCol1}">
<g:Label>Label 3</g:Label>
<g:Label>Label 4</g:Label>
</FlowPanel>
<FlowPanel addStyleNames="{res.css.itemDetailsOutputCol2}">
<g:Image url="http://www.someimage.com/generic.jpg"
ui:field="itemImage"
title="Item" altText="My alt"/>
</FlowPanel>
</FlowPanel>
</FlowPanel>
My css looks like this:
.itemDetailsInput {
display: table;
width: 500px;
margin: 5px;
width: 100%;
padding: 3px 5px 3px 5px;
}
.itemDetailsInputCol1{
display: table-cell;
width: 20%;
padding: 1em;
position: relative;
left: auto;
}
.itemDetailsInputCol2 {
width: 80%;
display: table-cell;
padding: 1em;
position: relative;
}
.itemDetailsOutput {
display: table;
width: 500px;
margin: 5px;
width: 100%;
padding: 3px 5px 3px 5px;
}
.itemDetailsOutputCol1{
display: table-cell;
width: 60%;
padding: 1em;
position: relative;
left: auto;
}
.itemDetailsOutputCol2 {
width: 40%;
display: table-cell;
padding: 1em;
position: relative;
}