And after a few minutes more thought, I'd probably want to bind at the
controller/presenter level. It doesn't make that much difference to
the previous example except that it requires nested paths (e.g.
boundTo="model.firstName" etc).
public class MyController {
interface MyBinder extends UiBinder<Widget,MyController>{}
MyFormModel model = ...;
ValueModel<Boolean> editingFirstName = ...;
UiCommand saveCommand = ...;
}
<g:FlowPanel pectin:showWhen="editingFirstName">
<g:TextBox pectin:boundTo="model.firstName">
<x:SomeValidationDisplayWidget
pectin:displayValidationOf="model.firstName"/>
<g:Button pectin:boundTo="saveCommand">Save</g:Button>
</g:FlowPanel>
Cheers
On Jun 7, 11:10 am, Andrew <
andrew.piet...@gmail.com> wrote:
> Hi Daniel,
>
> Direct support for UiBinder would be an enormous improvement and any
> contributions greatly appreciated. Initially I was hoping I could
> have do something like `interface MyFormBinder extends
> UiBinder<Widget, MyFormModel>` and then write markup perhaps somthing
> like:
>
> <g:FlowPanel pectin:showWhen="someBooleanField">
> <g:TextBox pectin:boundTo="firstName">
> <x:someWidget pectin:displayValidationOf="firstName">
> </g:FlowPanel>
>
> But this is all completely off the top of my head and involves
> vigorous arm waving. I haven't thought through the implications or
> considered how it might (or even if it can) be implemented.
>
> This approach also requires that UiBinder supports custom attribute
> parsers which I've only very briefly looked at. I noticed a while
> back there were some attempts to make the UiBinder more pluggable by
> other developers but this was focused on element parsers. I'm not
> sure what the current state of play is but here's some links I came
> across:
http://groups.google.co.uk/group/google-web-toolkit-contributors/brow...http://cafebab3.blogspot.com/2009/12/gwt-2-declarative-layout-beyond....