Tuesday, April 29, 2014

Re: UiBinder and writing custom parsers



On Monday, April 28, 2014 8:48:51 PM UTC+2, stuckagain wrote:
I need to write a custom widget that is to be used in UiBinder to easily layout a form of properly aligned fields (in multiple columns).

I tried to avoid using a custom widget by defining some resusable stylenames, but it would be much nicer if I could just abstract away whether you need a DIV/TABLE/TR/TD/SPAN/LABEL or any other HTML tag.
I gets complicated very quickly and if you have many screens there should be a lot more reuse possible.

I basically just want that the developer can do something like:

<x:FormWidget>
  <h1>Title<h1>
  <x:row><x:label>Label</x:label><x:field><w:TextBox ui:field='text'/></x:field></x:row>
  <x:row><x:label>Label 2</x:label><x:field><w:TextBox ui:field='text'></x:field></x:row>
</x:FormWidget>

So I need to be able to mix some plain HTML tags with some custom defined ones.


Is this the officially supported way of doing this ? There is no developer documentation available on this topic. 

There simply is no official way: https://code.google.com/p/google-web-toolkit/issues/detail?id=4461

Maybe you could use a RenderablePanel and IsRenderable widgets, but it's experimental: http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/IsRenderable.html
That said, in modern browsers (I know that you're unfortunately tied to older ones too), using widgets shouldn't really harm performance; the DOM has become quite fast recently (in some browsers, I've heard DOM manipulations can be faster than innerHTML)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment