Page 1 of 1

EntityForm - fields

Posted: Wed Jun 19, 2013 8:26 am
by sushma
I have a rest weservices class which has a method to add product .i have used the the generic add entity method (but have customized according to my requirement)
My method accepts a Product instance . i have a converter which basically takes the product instance values and
convert convert it to a Entityform , Now my problem is --
i have set my product instance values to fields (this is map<String,Field>)and i want to add this fields to the the entity form . how can i achieve this because there is no setters defined for this variable fields (which is defined in EntityForm) and its in protected mode .

Re: EntityForm - fields

Posted: Wed Jun 19, 2013 8:37 am
by sushma
// This is used to data-bind when this entity form is submitted
protected Map<String, Field> fields = null
i have added my product instance properties to this and trying to add it to entityform's property - "fields" .

Re: EntityForm - fields

Posted: Thu Jun 20, 2013 6:57 pm
by ktisdell
You can create your own JAXB classes to handle deserialization. One approach that we've taken is to use the APIUnwrapper interface. You can extend the ProductWrapper and implement APIUnwrapper to unwrap the values passed in and set them on a product.