[gwt-contrib] Re: gen2 tables: Create TableDefinition based on annotations
Any ideas why this is not working in compiled mode? I'm aware that my approach may be violating the generator approach but it would be interesting to know why it fails. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: gen2 tables: Create TableDefinition based on annotations
without-contextYou detect this case by checking if you've received a null PrintWriter. If so, you've already run, and should just return the appropriate new statement./without-context rjrjr On Fri, Dec 12, 2008 at 4:42 AM, John LaBanca jlaba...@google.com wrote: Do you get any specific error in web mode? The generator runs at compile time, so if it works in hosted mode, it should work in web mode. The main difference is that in hosted mode it should only run once, whereas in compiled mode it runs once per permutation. Your generator looks straight forward, but make sure your generator can the case where the generator runs multiple times. Thanks, John LaBanca jlaba...@google.com On Thu, Dec 11, 2008 at 12:29 PM, dflorey daniel.flo...@gmail.com wrote: Any ideas why this is not working in compiled mode? I'm aware that my approach may be violating the generator approach but it would be interesting to know why it fails. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: gen2 tables: Create TableDefinition based on annotations
This is very cool! Thanks, John LaBanca [EMAIL PROTECTED] On Fri, Nov 28, 2008 at 2:54 PM, dflorey [EMAIL PROTECTED] wrote: Uuups, only working in hosted mode :-( On 27 Nov., 13:07, dflorey [EMAIL PROTECTED] wrote: Hi, I've used that Generator stuff in gwt for the first time and I've to admit that it is really cool! I've been using it to simplify the creation of model based gen2- tables. Instead of defining the TableDefinition programmatically you now have the alternative to do it with annotations in your domain class. Example: public static class Ancestor extends AbstractTreeTableItem implements RowValue { private String firstName, lastName; private double iq; private Date dateOfBirth; public Ancestor(String firstName, String lastName, int iq, Date dateOfBirth) { this.firstName = firstName; this.lastName = lastName; this.iq = iq; this.dateOfBirth = dateOfBirth; } @ColumnDefinition(column = 0, header = First name, filterable = false) public String getFirstName() { return firstName; } @ColumnDefinition(column = 1, header = Last name) public String getLastName() { return lastName; } @ColumnDefinition(column = 2, header = IQ, numberFormat = NumberColumnFormat.SCIENTIFIC_FORMAT) public double getIq() { return iq; } @ColumnDefinition(column = 3, header = Date of birth, dateTimeFormat = DateColumnFormat.SHORT_DATE_FORMAT) public Date getDateOfBirth() { return dateOfBirth; } @Override public String getDisplayName() { return firstName + + lastName; } @Override public String getId() { return firstName + lastName + dateOfBirth; } } Note that you have to implement the RowValue marker interface. Now you are ready to create your TableDefinition like this: TableDefinitionAncestor tableDefinition = GWT.create (Ancestor.class); Very cool! Thanks for this brilliant toolkit!! --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: gen2 tables: Create TableDefinition based on annotations
Uuups, only working in hosted mode :-( On 27 Nov., 13:07, dflorey [EMAIL PROTECTED] wrote: Hi, I've used that Generator stuff in gwt for the first time and I've to admit that it is really cool! I've been using it to simplify the creation of model based gen2- tables. Instead of defining the TableDefinition programmatically you now have the alternative to do it with annotations in your domain class. Example: public static class Ancestor extends AbstractTreeTableItem implements RowValue { private String firstName, lastName; private double iq; private Date dateOfBirth; public Ancestor(String firstName, String lastName, int iq, Date dateOfBirth) { this.firstName = firstName; this.lastName = lastName; this.iq = iq; this.dateOfBirth = dateOfBirth; } @ColumnDefinition(column = 0, header = First name, filterable = false) public String getFirstName() { return firstName; } @ColumnDefinition(column = 1, header = Last name) public String getLastName() { return lastName; } @ColumnDefinition(column = 2, header = IQ, numberFormat = NumberColumnFormat.SCIENTIFIC_FORMAT) public double getIq() { return iq; } @ColumnDefinition(column = 3, header = Date of birth, dateTimeFormat = DateColumnFormat.SHORT_DATE_FORMAT) public Date getDateOfBirth() { return dateOfBirth; } @Override public String getDisplayName() { return firstName + + lastName; } @Override public String getId() { return firstName + lastName + dateOfBirth; } } Note that you have to implement the RowValue marker interface. Now you are ready to create your TableDefinition like this: TableDefinitionAncestor tableDefinition = GWT.create (Ancestor.class); Very cool! Thanks for this brilliant toolkit!! --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---