Split UIBinder File

60 views
Skip to first unread message

Markandayarushi Pamu

unread,
May 22, 2012, 7:08:53 AM5/22/12
to Google Web Toolkit, pmr...@gmail.com, pmr...@yahoo.com
Hi All,

I have one requirement in GWT UIBinder.

I want to split the UIBinder file, like <include > in jsp.

I want to add another uibinder into this.

Plz suggest how to add..

Rushi

Joseph Lust

unread,
May 22, 2012, 9:30:51 AM5/22/12
to google-we...@googlegroups.com, pmr...@gmail.com, pmr...@yahoo.com
Just make several widgets. Each widget can have its own UiBinder file. Then you can combine them at a higher level like:

#UiBinder file
...
<myWidget1></myWidget1>
<myWidget2></myWidget2> 
<myWidget3></myWidget3> 
...

Can you explain why you need the file broken out? Perhaps a messages (i18n) file/interface will work if you want to pull in dynamic content or settings.

If you're looking to pull in settings/strings/content from another file you can do this like:


#UiBinder file 
...
<ui:with field='msg' type='com.foo.MyMessages'/> 
<someWidget>
<ui:text from="{msg.someString}"/>
</someWidget>
...




Sincerely,
Joseph

Joseph Lust

unread,
May 23, 2012, 11:23:26 AM5/23/12
to google-we...@googlegroups.com, pmr...@gmail.com, pmr...@yahoo.com
Markandayarushi,

In response to your reply from last night, I don't know of any way to include raw XML from another *.ui.xml file into a UiBinder file. This is against the design of the UiBinder. You said you want to break a UiBinder out into several files for "separation of concerns." I suggest you use the above example of breaking your page into UiBinder widgets as this is the standard GWT UiBinder pattern.

The Using Panels example in the docs is a good example of this: https://developers.google.com/web-toolkit/doc/latest/DevGuideUiBinder#Panels

Sincerely,
Joseph
Reply all
Reply to author
Forward
0 new messages