Class CompoundRecordModel<R extends SRecordInstance>
java.lang.Object
com.inductiveautomation.ignition.gateway.web.models.CompoundRecordModel<R>
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IChainingModel<List<R>>
,org.apache.wicket.model.IComponentInheritedModel<List<R>>
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<List<R>>
,org.apache.wicket.util.io.IClusterable
public class CompoundRecordModel<R extends SRecordInstance>
extends Object
implements org.apache.wicket.model.IComponentInheritedModel<List<R>>, org.apache.wicket.model.IChainingModel<List<R>>
An implementation of model that is both chaining and inherited. The value represented by this model is always a list
of SRecordInstance objects (one or more), with at most one record for any given RecordMeta type. They may be nested
in deeper models (for instance, a LoadableDetchableModel). Components that wish to use this model by inheritance
should implement IRecordFieldComponent. They may also use the field name as their Id, so long as the field name is
unique among the types of records represented.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundRecordModel
(List<R> records) Creates a CompoundRecordModel directly on the record instanceCompoundRecordModel
(org.apache.wicket.model.IModel<List<R>> targetModel) Creates a a CompoundRecordModel using a chained model.CompoundRecordModel
(R... records) Creates a CompoundRecordModel directly on the record instance -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.wicket.model.IModel
bind
(SFieldMeta field) Binds this model to a specific field by returning a model that has this compound model as its nested/wrapped model and the property which should be evaluated.void
detach()
org.apache.wicket.model.IModel<?>
void
setChainedModel
(org.apache.wicket.model.IModel<?> model) void
org.apache.wicket.model.IWrapModel<Object>
wrapOnInheritance
(org.apache.wicket.Component component)
-
Constructor Details
-
CompoundRecordModel
Creates a CompoundRecordModel directly on the record instance -
CompoundRecordModel
Creates a CompoundRecordModel directly on the record instance -
CompoundRecordModel
Creates a a CompoundRecordModel using a chained model. The target model must return a List of SRecordInstance from getObject()
-
-
Method Details
-
getObject
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<R extends SRecordInstance>
- See Also:
-
IModel.getObject()
-
setObject
- Specified by:
setObject
in interfaceorg.apache.wicket.model.IModel<R extends SRecordInstance>
- See Also:
-
IModel.setObject(java.lang.Object)
-
getObjectAsRecordList
-
bind
Binds this model to a specific field by returning a model that has this compound model as its nested/wrapped model and the property which should be evaluated. This can be used if the id of the Component isn't a valid property for the record.- Returns:
- The IModel that is a wrapper around the current model and the field
-
wrapOnInheritance
public org.apache.wicket.model.IWrapModel<Object> wrapOnInheritance(org.apache.wicket.Component component) - Specified by:
wrapOnInheritance
in interfaceorg.apache.wicket.model.IComponentInheritedModel<R extends SRecordInstance>
-
detach
public void detach()- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
-
getChainedModel
public org.apache.wicket.model.IModel<?> getChainedModel()- Specified by:
getChainedModel
in interfaceorg.apache.wicket.model.IChainingModel<R extends SRecordInstance>
- See Also:
-
IChainingModel.getChainedModel()
-
setChainedModel
public void setChainedModel(org.apache.wicket.model.IModel<?> model) - Specified by:
setChainedModel
in interfaceorg.apache.wicket.model.IChainingModel<R extends SRecordInstance>
-