On Monday, January 7, 2013 12:58:36 AM UTC+1, [email protected] wrote: > > Hello all, > > first of all I'm sorry if I sound incompetent but the truth is I'm fairly > new to GWT. So here's what I want to do: I have a database with different > itemtypes (Product, User, Country, etc...). > I want to make a GWT application that edits these item types. For that > purpose I have created a dto called EntityDto which contains a list of > SectionDto, which in itself contains a list of PropertyDto. So the > PropertyDto is a representation of each of the item's properties > (Product.code for instance). The PropertyDto has the following signature: > > public class PropertyDto implements Serializable { > > private String id; > private String value; > > /* getters/setters */ > .... > } > > So I have managed to display a form with TextField for the Entity's > properties and their values. Now I want to submit the changed values and > persist them in the database. As I was reading on the internet this is > achieved using a combination of a Driver and Editor. My problem is that I > don't have a real POJO to use any of the existing drivers. All I want is to > map the field with id code, for instance, to the String in > EntityDto.PropertyDto.value (for whichever PropertyDto has the same id). > > Is there any solution to this? How would you create a form that is not > backed by a bean but instead by a dynamic map or a list for instance? >
In any case, you'll have to do it manually. If you need to use the Editor framework, and/or your scenario is complex enough to make it worth it, then you can use a ValueAwareEditor<SectionDto>: in setValue you loop over the PropertyDto-s and push their values to the corresponding text box, and in flush() you do the reverse (from text box to PropertyDto). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/7V-aY79n5dkJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
