Class ComponentDetachableModel<T>

    • Method Detail

      • setObject

        public final void setObject​(T object)
        Description copied from interface: IModel
        Sets the model object.
        Specified by:
        setObject in interface IModel<T>
        Parameters:
        object - The model object
      • isAttached

        public final boolean isAttached()
        Gets whether this model has been attached to the current session.
        Returns:
        whether this model has been attached to the current session
      • setAttached

        protected final void setAttached()
        Set this model in an attached state. Called if the constructor sets the data. (attached)
      • attach

        protected void attach()
        Attaches to the current request. Implement this method with custom behavior, such as loading the model object.
      • getObject

        protected T getObject​(Component component)
        Called when getObject is called in order to retrieve the detachable object. Before this method is called, attach() is always called to ensure that the object is attached.
        Parameters:
        component - The component asking for the object
        Returns:
        The object
      • setObject

        protected void setObject​(Component component,
                                 T object)
        Called when setObject is called in order to change the detachable object. Before this method is called, attach() is always called to ensure that the object is attached.
        Parameters:
        component - The component asking for replacement of the model object
        object - The new model object