Saturday, January 29, 2011

Re: Issue 5752: ListEditor.setValue fails once the underlying AutoBean has been frozen

The other question: Is there a way to not to write custom FieldCustomizer for columns? Can't GWT know which proxy/property I am editing? Or am I doing something wrong? Thanks!

Assuming by FieldCustomizer you mean FieldUpdater... It seems not – the Column.getValue method must be implemented to load data and the FieldUpdater.update call to put it back again. I am trying to make a simple generator to turn an interface like

interface RouteColumns extends Columns<MyBean> {

@Header("Name")

@Editable()

EditTextCell name();

@Header("Description")

@Alignment(horizontal=HorizontalAlign.JUSTIFY)

TextCell description();

}

into a set of columns where the MyBean class has get/set calls for name and description. The Columns marker interface has a .configure call which goes through and adds each column in order to the CellTable.


It isn't perfect by any stretch, but it seems to fill a hole that code generation can solve. One remaining issue I would be interested in feedback on is how to i18n the header text. I've thought about requiring that the Constants interface this would use (probably indicated via an annotation to this type) have methods named the same as the methods in the interface...


Hope this sparks some thoughts in others – let me know if you are interested, and I will share a working version in the next few days.


-Colin

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

No comments:

Post a Comment