extending uiBinder - give support to 3rd party GUI JavaScript toolkits

146 views
Skip to first unread message

Sebastián Gurin

unread,
Oct 28, 2012, 4:11:26 PM10/28/12
to google-we...@googlegroups.com
Hi all. I have ported a GUI JavaScript library to GWT - http://code.google.com/p/yuigwt/ . I would like yuigwt users be able to use YUI widgets in uibinder.

YUI (yuigwt) defines its own Widget infrastructure and class hierarchy, event handling, etc and it not depends on GWT widgets and GWT DOM.  It also has some rudimentary support for displaying YUI widgets inside GWT Widgets and viceversa, and the same for com.google.gwt.dom.client.*

As I understand from javadocs, all my custom UIBinder classes must inherit from com.google.gwt.user.client.ui.UIObject. But it seems it do not support events, so I guess this mean uiBinder is dependent on GWT Widgets.

I have found no documentation or forum post dedicated explicitly to UIBinder and 3rd party javascript toolkits interoperability.  Also I have found some projects aimed to do this like http://code.google.com/p/gwt-customuibinder/, but I'm not sure to use them.

So my questions are, for defining UIBinder classes to support YUI Widgets,

1) is there are a way of support uibinder Events without working with GWT Widgets API?

2) Do I need to base my uibinder on GWT Widget ? An I obligated to work with my rudimentary GWT widget - YUI widget intoroperability ?

3) any one have any expertice in this field (give 3rd party JavaScript toolkits ported to GWT uiBinder support ? )

Thanks in advance.

Alain Ekambi

unread,
Oct 28, 2012, 4:53:47 PM10/28/12
to google-we...@googlegroups.com
Touch4j (http://www.emitrom.com/touch4j) does support UI Binder  but we also extend from GWT Widget though. We wrap Sencha Touch but  the widgets are GWT compatible. I dont know if it s possible to support UI Binder without extending from Widget.

Thomas ? :)



2012/10/28 Sebastián Gurin <sebast...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ByAlGyu1AVwJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Sebastián Gurin

unread,
Oct 29, 2012, 8:31:00 AM10/29/12
to google-we...@googlegroups.com
Nino, thank you for you comments. Finnaly I was able to create a simple GWT Widget class hierarchy that wrap my YUI widgets, extending Composite class. So I'm using widgets minimally, but not events - if the user wants events support then it should use the YUI Event API in its .java files, not GWT's.

At this time I can write my yui widgets in UIBinder's XML without trouble. The only bad thing is the following.

My yui widgets are instantiated using a YUIContext object  (a JSO) . (it is a porting based 100% on overlay types). So my GWT widget wrappers need access to this object. The bad thing is that I cannot find a way to pass that object from UIBinder markup to my children YUI wrapped widgets. Currently I'm using a static field for storing this object, and the user is responsible of setting it statically before rendering anything with uibinder , and all my widgets classes uses this static property internally for the native instantiation.

Question: There is any way of telling uibinder root widget to automatically pass an object to its childrens, or automatically call a setter on its childs for setting this object (automatically)?

Regards, hope I made myself clear.

P/S: I'm just starting with UIBinder , the lack of UIBinder documentation make it strange how well this technology is adopted.

Joseph Lust

unread,
Oct 29, 2012, 12:01:04 PM10/29/12
to google-we...@googlegroups.com
Sebastián,

Depending on how you're implementing these in UiBinder, you could use the @UiChild annotation and let the parent create its children. This way it can create and story references to the parent of the child as needed because it creates them.


Sincerely,
Joseph

Sebastián Gurin

unread,
Oct 29, 2012, 5:45:14 PM10/29/12
to google-we...@googlegroups.com
Thank you Joseph, I'm researching the use of @UIChild now. Also I have posted another related question at https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/-Ed_fnqeFTU

Regards

Sebastián Gurin

unread,
Nov 13, 2012, 6:50:16 AM11/13/12
to google-we...@googlegroups.com
Finally, I was able to successfully integrate YUI JavaScript library in UIbinder. I didn't use GWT Widgets for the binding bu t DOM Element directly and take advance of YUI Widget HTML Markup definitions. Written some notes at http://cancerbero.mbarreneche.com/yuigwt/gallery/?test=uibinderuserguide&singleTest=1 using this same proposed technology (YUI+uibinder). Hope it can be of help for others in a similar situation.
Reply all
Reply to author
Forward
0 new messages