public interface IRequestableComponent
Modifier and Type | Method and Description |
---|---|
boolean |
canCallListenerAfterExpiry() |
void |
detach()
Detaches the component.
|
IRequestableComponent |
get(String path)
Gets the component at the given path.
|
Behavior |
getBehaviorById(int id)
Gets the behavior for the specified id
|
int |
getBehaviorId(Behavior behavior)
Gets a stable id for the specified behavior.
|
String |
getId()
Gets the id of this component.
|
IRequestablePage |
getPage()
Returns page this component belongs to.
|
String |
getPageRelativePath()
Gets this component's path.
|
String getPageRelativePath()
String getId()
IRequestablePage getPage() throws WicketRuntimeException
WicketRuntimeException
- Thrown if component is not yet attached to a Page.IRequestableComponent get(String path)
path
- Path to componentint getBehaviorId(Behavior behavior)
behavior
- Behavior getBehaviorById(int id)
id
- null
if noneInvalidBehaviorIdException
- when behavior with this id cannot be foundvoid detach()
NOTE: this method is not inherited from IDetachable
on purpose. in Wicket the
assumption for a long time has been that Component
s do not implement
IDetachable
; doing so may lead to some very nasty side-effects. Consider
AbstractPropertyModel#detach()
which looks like this:
public void detach() { // Detach nested object if it's a detachable if (target instanceof IDetachable) { ((IDetachable)target).detach(); } }If the model was constructed thusly, which is quite common:
new PropertyModel(this,
"person")
and Component
implemented IDetachable
then calling @{code
model.detach()} will cause an infinite loop with the model trying to detach the component and
the component trying to detach the model.
boolean canCallListenerAfterExpiry()
true
if it is save to call an IRequestListener
on this component
when the owner page is freshly created after expirationCopyright © 2006–2018 Apache Software Foundation. All rights reserved.