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 Details

    • CompoundRecordModel

      public CompoundRecordModel(R... records)
      Creates a CompoundRecordModel directly on the record instance
    • CompoundRecordModel

      public CompoundRecordModel(List<R> records)
      Creates a CompoundRecordModel directly on the record instance
    • CompoundRecordModel

      public CompoundRecordModel(org.apache.wicket.model.IModel<List<R>> targetModel)
      Creates a a CompoundRecordModel using a chained model. The target model must return a List of SRecordInstance from getObject()
  • Method Details

    • getObject

      public List<R> getObject()
      Specified by:
      getObject in interface org.apache.wicket.model.IModel<R extends SRecordInstance>
      See Also:
      • IModel.getObject()
    • setObject

      public void setObject(List<R> object)
      Specified by:
      setObject in interface org.apache.wicket.model.IModel<R extends SRecordInstance>
      See Also:
      • IModel.setObject(java.lang.Object)
    • getObjectAsRecordList

      public List<SRecordInstance> getObjectAsRecordList()
    • bind

      public org.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. 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 interface org.apache.wicket.model.IComponentInheritedModel<R extends SRecordInstance>
    • detach

      public void detach()
      Specified by:
      detach in interface org.apache.wicket.model.IDetachable
    • getChainedModel

      public org.apache.wicket.model.IModel<?> getChainedModel()
      Specified by:
      getChainedModel in interface org.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 interface org.apache.wicket.model.IChainingModel<R extends SRecordInstance>