|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.data.Record
public class Record
A Record contains attributes that are displayed and edited by a DataBoundComponent.
DynamicForm) or may work with lists
(ListGrid), trees (TreeGrid), or cubes
(CubeGrid) of records.
A Record is always the same type of Java object regardless of how the record is loaded (static
data, java server, XML web service, etc). However, individual DataBoundComponents may also
look for special attributes on Records which control styling or behavior. For convenience,
there are subclasses of Record with type-safe setters for such attributes (such as ListGrid.setRecordEditProperty(String)). In reality, all
such subclasses are wrappers over the same underlying data object, and you can convert to
whichever wrapper is most convenient via:
new ListGridRecord(recordInstance.getJsObj());
You can also create your own subclass of Record with type-specific getters and setters,
however, if you do so, you should store values via setAttribute() and retrieve them via
getAttribute() rather than keeping values as normal Java properties. Only attributes will
be visible to DataBoundComponents, ordinary Java properties will not.
Note that directly changing an attribute of a Record via setAttribute() will not notify any
DataBoundComponents that the Record has changed or cause any kind of persistence operation
to occur. Instead, use component-specific methods such as DynamicForm.setValue() or
ListGrid.setEditValue() to explicitly tell the components about a change that should be
saved.
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.JsObject |
|---|
jsObj |
| Constructor Summary | |
|---|---|
Record()
|
|
Record(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
Record(java.util.Map recordProperties)
|
|
| Method Summary | |
|---|---|
static Record[] |
convertToRecordArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
|
static Record |
copyAttributes(Record record,
java.lang.String... properties)
Creates a shallow copy of record containing its attributes for properties
named in properties. |
static void |
copyAttributesInto(Record destRecord,
Record record,
java.lang.String... properties)
Shallow copies the attributes of record to destRecord for
properties named in properties. |
Record[] |
getAttributeAsRecordArray(java.lang.String property)
Returns the nested structure as Record array. |
RecordList |
getAttributeAsRecordList(java.lang.String property)
Returns the nested structure as a RecordList. |
static Record |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.util.Map |
toMap()
Convert this record to a Map. |
| Methods inherited from class com.smartgwt.client.core.RefDataClass |
|---|
getRef, getRef |
| Methods inherited from class com.smartgwt.client.core.JsObject |
|---|
isCreated, setJsObj |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Record()
public Record(com.google.gwt.core.client.JavaScriptObject jsObj)
public Record(java.util.Map recordProperties)
| Method Detail |
|---|
public static Record copyAttributes(Record record,
java.lang.String... properties)
record containing its attributes for properties
named in properties.
record - the record to copy attributes from.properties - an array of properties to copy.
record containing only the attributes for properties
named in properties.
public static void copyAttributesInto(Record destRecord,
Record record,
java.lang.String... properties)
record to destRecord for
properties named in properties.
destRecord - (out) destination record into which attributes are copied.record - the record to copy attributes from.properties - an array of properties to copy.public static Record getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public Record[] getAttributeAsRecordArray(java.lang.String property)
property - the record property
public RecordList getAttributeAsRecordList(java.lang.String property)
property - the record property
public static Record[] convertToRecordArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
public java.util.Map toMap()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||