As GWT is adding widgets in Horizontal panel, in the same way I want
to get element in my composite widgets so that I can manage their
layout in onAttach means I want to get label and html in RComposite
widget's on attach.
ui.xml
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:my='urn:import:gwt.testui.client'>
<my:RCompositeWidget>
<g:Label>My Widgets</g:Label>
<g:HTML>in a row</g:HTML>
</my:RCompositeWidget>
</ui:UiBinder>
-->RCompositeWidget
public class RCompositeWidget extends Composite {
public RCompositeWidget() {
HorizontalPanel hp = new HorizontalPanel();
initWidget(hp);
}
}
But I am getting following exception:
In com.google.gwt.uibinder.rebind.XMLElement$1@870aad, found
unexpected child "<g:Label>"
Regards
Rick
RCompositeWidget has to implement HasWidgets if it's meant to be a
widget container, otherwise how would UiBinder add the widgets to it?
Actually, UiBinder does not know that RCompositeWidget internally uses
an HorizontalPanel.
Widgets are now adding by implementing HasWidgets interface.
But I need to do a little more. As there are tags in DockLayoutPanel
-- <g:north>, <g:west>, in the same way, I want to create my own
customized tags like <my:left>,<my:right> etc so that I can arrange my
layout accordingly. Can it be possible. If it is, kindly let me know
as it will be a great help for me to design my UI with more
flexibility,
On Dec 21, 7:44 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On Dec 21, 12:13 pm, Rick <rick4...@gmail.com> wrote:
>
>
>
> > Hi all
>
> > As GWT is adding widgets in Horizontal panel, in the same way I want
> > to get element in my composite widgets so that I can manage their
> > layout in onAttach means I want to get label and html in RComposite
> > widget's on attach.
>
> > ui.xml
> > <ui:UiBinderxmlns:ui='urn:ui:com.google.gwt.uibinder'
> > xmlns:g='urn:import:com.google.gwt.user.client.ui'
> > xmlns:my='urn:import:gwt.testui.client'>
>
> > <my:RCompositeWidget>
>
> > <g:Label>My Widgets</g:Label>
> > <g:HTML>in a row</g:HTML>
>
> > </my:RCompositeWidget>
>
> > </ui:UiBinder>
> > -->RCompositeWidget
> > public class RCompositeWidget extends Composite {
> > public RCompositeWidget() {
> > HorizontalPanel hp = new HorizontalPanel();
> > initWidget(hp);
> > }
>
> > }
>
> > But I am getting following exception:
> > In com.google.gwt.uibinder.rebind.XMLElement$1@870aad, found
> > unexpected child "<g:Label>"
>
> RCompositeWidget has to implement HasWidgets if it's meant to be a
> widget container, otherwise how wouldUiBinderadd the widgets to it?
> Actually,UiBinderdoes not know that RCompositeWidget internally uses
> an HorizontalPanel.
I request from GWT members to reply this post please.
Regards
Rick
On Dec 22, 5:28 am, Rick <rick4...@gmail.com> wrote:
> Thanks Thomas
>
> Widgets are now adding by implementing HasWidgets interface.
>
> But I need to do a little more. As there are tags in DockLayoutPanel
> -- <g:north>, <g:west>, in the same way, I want to create my own
> customized tags like <my:left>,<my:right> etc so that I can arrange my
> layout accordingly. Can it be possible. If it is, kindly let me know
> as it will be a great help for me to design my UI with more
> flexibility,
This is planned, but not yet available (there's a TODO in the code),
unless of course you patch GWT.
I am successful to create my customized tag by patching UIBinderWriter
-> registerParsers() method. I think GWT has done most of the work for
supporting customized tag but keeping it private.
On Dec 24 2009, 5:15 am, Rick <rick4...@gmail.com> wrote:
> Thanks Thomas
>
You need to write your own parser taking clue from
DockLayoutPanelParser. Then You need to register this parser in
UIBinderWriter's registerParsers() method.
Feel free if I can further help.
Thanks and regards
Rick
On Jan 4, 6:11 pm, Hans Speijer <hans.spei...@gmail.com> wrote:
> Any news on this topic? Could you be a bit more specific on how you
> patched UIBinderWriter?
>
> On Dec 24 2009, 5:15 am, Rick <rick4...@gmail.com> wrote:
>
>
>
> > Thanks Thomas
>
> > I am successful to create mycustomizedtag by patching UIBinderWriter