Tuesday, April 29, 2014

Re: UiBinder and writing custom parsers

I did not know about the RenderablePanel, I will try to play with it a bit. 

Maybe I can stick with some custom widgets for now, most forms that I need don't need hundreds of widgets so I guess even on IE9 performance should be good enough.

I look forward in seeing where GWT 3.0 is going with UiBinder or something more like Angular.



On Tue, Apr 29, 2014 at 1:04 PM, Thomas Broyer <t.broyer@gmail.com> wrote:


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. 


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.

--
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