org.apache.wicket.request.component
Interface IRequestableComponent
- All Known Subinterfaces:
- IRequestablePage
- All Known Implementing Classes:
- AbstractCheckSelector, AbstractChoice, AbstractErrorPage, AbstractItem, AbstractLink, AbstractOutputTransformerContainer, AbstractPageableView, AbstractRepeater, AbstractSingleSelectChoice, AbstractSubmitLink, AbstractTextComponent, AccessDeniedPage, AjaxButton, AjaxCheckBox, AjaxFallbackButton, AjaxFallbackLink, AjaxLink, AjaxPagingNavigation, AjaxPagingNavigationIncrementLink, AjaxPagingNavigationLink, AjaxPagingNavigator, AjaxSubmitLink, AutoLabelResolver.AutoLabel, AutoLinkResolver.AutolinkBookmarkablePageLink, BaseWicketTester.StartComponentInPage, Body, BookmarkablePageLink, Border, Border.BorderBodyContainer, BorderPanel, BoxBorder, BrowserInfoForm, BrowserInfoPage, Button, Check, CheckBox, CheckBoxMultipleChoice, CheckboxMultipleChoiceSelector, CheckBoxSelector, CheckGroup, CheckGroupSelector, ClientSideImageMap, Component, ComponentFeedbackPanel, ContextImage, DataView, DataViewBase, DownloadLink, DropDownChoice, DummyHomePage, DummyHomePage.TestLink, DummyPanelPage, EmailTextField, EmptyPanel, Enclosure, EnclosureContainer, EnumLabel, ExceptionErrorPage, ExternalLink, FeedbackPanel, FencedFeedbackPanel, FileUploadField, Form, FormComponent, FormComponentFeedbackBorder, FormComponentFeedbackIndicator, FormComponentLabel, FormComponentPanel, Fragment, GenericPanel, GenericWebPage, GridView, HeaderPartContainer, HeaderResponseContainer, HiddenField, HtmlHeaderContainer, HtmlHeaderItemsContainer, Image, ImageButton, Include, InlineEnclosure, InlineFrame, InlineImage, InternalErrorPage, Item, Label, LabeledWebMarkupContainer, Link, ListChoice, ListItem, ListMultipleChoice, ListView, Loop, LoopItem, MarkupContainer, MockHomePage, MultiFileUploadField, MultiLineLabel, NonCachingImage, NoopOutputTransformerContainer, NumberTextField, OddEvenItem, OddEvenListItem, Page, PageableListView, PageExpiredErrorPage, PageView, PagingNavigation, PagingNavigationIncrementLink, PagingNavigationLink, PagingNavigator, Panel, PasswordTextField, PopupCloseLink, PopupCloseLink.ClosePopupPage, PropertyListView, Radio, RadioChoice, RadioGroup, RangeTextField, RedirectPage, RefreshingView, RepeatingView, RequiredTextField, ResourceLink, SimpleFormComponentLabel, StatelessForm, StatelessLink, SubmitLink, TextArea, TextField, TransparentWebMarkupContainer, UrlTextField, WebComponent, WebMarkupContainer, WebPage, XsltOutputTransformerContainer
public interface IRequestableComponent
Base interface for components. The purpose of this interface is to make certain parts of Wicket
easier to mock and unit test.
- Author:
- Matej Knopp
getPageRelativePath
String getPageRelativePath()
- Gets this component's path.
- Returns:
- Colon separated path to this component in the component hierarchy
getId
String getId()
- Gets the id of this component.
- Returns:
- The id of this component
getPage
IRequestablePage getPage()
- Returns page this component belongs to.
- Returns:
- page instance or
null
get
IRequestableComponent get(String path)
- Gets the component at the given path.
- Parameters:
path
- Path to component
- Returns:
- The component at the path
getBehaviorId
int getBehaviorId(Behavior behavior)
- Gets a stable id for the specified behavior. The id remains stable from the point this method
is first called for the behavior until the behavior has been removed from the component
- Parameters:
behavior
-
- Returns:
- a stable id for the specified behavior
getBehaviorById
Behavior getBehaviorById(int id)
- Gets the behavior for the specified id
- Parameters:
id
-
- Returns:
- behavior or
null
if none
- Throws:
InvalidBehaviorIdException
- when behavior with this id cannot be found
detach
void detach()
- Detaches the component.
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.
Copyright © 2006–2016 Apache Software Foundation. All rights reserved.