|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD | |||||||
java.lang.Objectcom.vaadin.data.util.PropertysetItem
org.grails.plugin.vaadin.data.DomainItem
class DomainItem extends PropertysetItem
Similar to BeanItem but for GrailsDomainClass instances.
Main benefits over BeanItem is that this class supports embedded property types, and arbitrary nesting of properties.
| Field Summary | |
|---|---|
protected Map |
changedProperties
All changed properties for the domain instance. |
| Property Summary | |
|---|---|
org.codehaus.groovy.grails.commons.GrailsDomainClass |
domainClass
The domain class of the domain instance |
Object |
domainInstance
The domain instance of this item |
| Constructor Summary | |
DomainItem(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication, Object domainInstance)
Create a domain item for the specified domain instance. |
|
DomainItem(org.codehaus.groovy.grails.commons.GrailsDomainClass domainClass, Object domainInstance)
Create a domain item for the specified domain instance with the specified domain class. |
|
| Method Summary | |
|---|---|
Property
|
getItemProperty(Object id)
Gets the property with the specified name from the domainInstance stored in this item. |
protected List
|
getPropertyDescriptors(org.codehaus.groovy.grails.commons.GrailsDomainClass domainClass)
Get GrailsDomainClass properties as VaadinPropertyDescriptors |
| Methods inherited from class PropertysetItem | |
|---|---|
| equals, toString, hashCode, clone, getListeners, addListener, removeListener, getItemProperty, getItemPropertyIds, removeItemProperty, addItemProperty, wait, wait, wait, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
protected Map changedProperties
domainInstance.properties = changedProperties.
This ensures that errors are not lost for other fields, whenever we set a value on a particular field.
| Property Detail |
|---|
final org.codehaus.groovy.grails.commons.GrailsDomainClass domainClass
final Object domainInstance
| Constructor Detail |
|---|
DomainItem(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication, Object domainInstance)
grailsApplication - Required to obtain the domain instance's domain class.domainInstance - The domain instance for which the item will be created.
DomainItem(org.codehaus.groovy.grails.commons.GrailsDomainClass domainClass, Object domainInstance)
domainClass - The domain class of the specified instance.domainInstance - The domain instance for which the item will be created.
| Method Detail |
|---|
Property getItemProperty(Object id)
Note that the property may be arbitrarily-nested, for example foo.bar.tick.tock
If the property is valid, and has not been accessed before, its name is added to the list of property id's for this item.
id - the identifier (name) of the Property to get.null
protected List getPropertyDescriptors(org.codehaus.groovy.grails.commons.GrailsDomainClass domainClass)
domainClass - The Grails domain class to get properties for.
Groovy Documentation