wicket.markup.html.form.model
Class DetachableChoiceList

java.lang.Object
  extended bywicket.markup.html.form.model.ChoiceList
      extended bywicket.markup.html.form.model.DetachableChoiceList
All Implemented Interfaces:
IChoiceList, IDetachable, java.io.Serializable

public abstract class DetachableChoiceList
extends ChoiceList

Adds attach/detach logic to ChoiceList.

Author:
Johan Compagner, Eelco Hillenius, Jonathan Locke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class wicket.markup.html.form.model.ChoiceList
ChoiceList.Choice
 
Constructor Summary
DetachableChoiceList()
          Construct.
DetachableChoiceList(java.util.Collection collection)
          Construct.
DetachableChoiceList(int initialCapacity)
          Construct.
 
Method Summary
 void attach()
          Attaches model for use.
 void detach()
          Detaches model after use.
protected  void onAttach()
          Attach to the current request.
protected  void onDetach()
          Detach from the current request.
 
Methods inherited from class wicket.markup.html.form.model.ChoiceList
add, addAll, choiceForId, choiceForObject, clear, get, getList, newChoice, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetachableChoiceList

public DetachableChoiceList()
Construct.


DetachableChoiceList

public DetachableChoiceList(int initialCapacity)
Construct.

Parameters:
initialCapacity - The initial capacity

DetachableChoiceList

public DetachableChoiceList(java.util.Collection collection)
Construct.

Parameters:
collection - a collection
Method Detail

attach

public final void attach()
Description copied from interface: IChoiceList
Attaches model for use. This is generally used to fill in transient fields in a model which has been serialized during session replication.

Specified by:
attach in interface IChoiceList
Overrides:
attach in class ChoiceList
See Also:
IChoiceList.attach()

detach

public final void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

Specified by:
detach in interface IDetachable
Overrides:
detach in class ChoiceList
See Also:
IDetachable.detach()

onAttach

protected void onAttach()
Attach to the current request. Implement this method with custom behaviour, such as loading the list of object you need for this list.


onDetach

protected void onDetach()
Detach from the current request. Implement this method with custom behaviour, such as clearing the list.



Copyright © 2004-2005 Wicket developers. All Rights Reserved.