Class WRepeater.WRepeatRoot
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.WRepeater.WRepeatRoot
-
- All Implemented Interfaces:
BeanAware
,BeanBound
,BeanProvider
,BeanProviderBound
,Container
,DataBound
,NamingContextable
,WComponent
,WebComponent
,Serializable
- Enclosing class:
- WRepeater
public static class WRepeater.WRepeatRoot extends WBeanComponent implements BeanProvider, Container, NamingContextable
Component to hold the repeated component and provide the correct row data.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WRepeatRoot(WRepeater repeater, WComponent repeatedComponent)
Creates a WRepeatRoot.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getBean(BeanProviderBound beanProviderBound)
WRepeatRoot will act as a provider for a provider bound repeated component.WComponent
getChildAt(int index)
Retrieves a child component by its index.int
getChildCount()
List<WComponent>
getChildren()
Retrieves a list of this Container's.String
getId()
Return an identifier for this component, generating one if necessary.String
getIdName()
Override WComponent name to include a row index.int
getIndexOfChild(WComponent childComponent)
Retrieves the index of the given child.String
getInternalId()
Override WComponent internal id to include a row index.String
getNamingContextId()
Allow components that implementNamingContextable
to selectively disable prepending their ID to their descendent's IDs by breaking the prepending logic into a seperately callable method.WComponent
getRepeatedComponent()
boolean
isNamingContext()
A naming context is only considered active if an Id name has been set.boolean
isVisible()
WRepeatRoot is part of the tree, but we don't want any request handling or painting to be performed on it automatically.void
setData(Object rowData)
Override setData in order to push data to non-BeanProviderBound
renderers each time the data is changed.-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, getComponentModel, getData, getOrCreateComponentModel, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, newComponentModel, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setSearchAncestors, updateBeanValue
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, paint, paintComponent, preparePaint, preparePaintComponent, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, toString, validate, validateComponent, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Constructor Detail
-
WRepeatRoot
public WRepeatRoot(WRepeater repeater, WComponent repeatedComponent)
Creates a WRepeatRoot.- Parameters:
repeater
- the parent repeaterrepeatedComponent
- the component to repeat.
-
-
Method Detail
-
getBean
public Object getBean(BeanProviderBound beanProviderBound)
WRepeatRoot will act as a provider for a provider bound repeated component.- Specified by:
getBean
in interfaceBeanProvider
- Parameters:
beanProviderBound
- expected to be the repeated component.- Returns:
- the Bean for the provider bound component.
-
getRepeatedComponent
public WComponent getRepeatedComponent()
- Returns:
- the component which is being repeated.
-
setData
public void setData(Object rowData)
Override setData in order to push data to non-BeanProviderBound
renderers each time the data is changed.- Specified by:
setData
in interfaceDataBound
- Overrides:
setData
in classWBeanComponent
- Parameters:
rowData
- the data for this row.
-
getInternalId
public String getInternalId()
Override WComponent internal id to include a row index.- Specified by:
getInternalId
in interfaceWComponent
- Overrides:
getInternalId
in classAbstractWComponent
- Returns:
- the internal id for this WComponent in the given context.
-
getId
public String getId()
Return an identifier for this component, generating one if necessary.The implementation must follow these steps in determining the Id:
If has id name set:- Find the closest ancestor to this component in the tree hierarchy that is an active
NamingContextable
. - If no context found, then let the ID be the idname.
- If a context found, then let the ID be
NamingContextable.getNamingContextId()
+WComponent.ID_CONTEXT_SEPERATOR
+ id name.
- If the component's parent is null, then let the ID be
WComponent.DEFAULT_NO_ID
. - If has a parent, then let the ID prefix be parent.getId() or parent.getNamingContextID() +
WComponent.ID_CONTEXT_SEPERATOR
if the parent is an active NamingContext. Then let the ID be prefix + generate unique id.
- Specified by:
getId
in interfaceWComponent
- Specified by:
getId
in interfaceWebComponent
- Overrides:
getId
in classAbstractWComponent
- Returns:
- the id for this WComponent in the current context.
- Find the closest ancestor to this component in the tree hierarchy that is an active
-
getIdName
public String getIdName()
Override WComponent name to include a row index.- Specified by:
getIdName
in interfaceWComponent
- Overrides:
getIdName
in classAbstractWComponent
- Returns:
- the name for this WComponent in the given context.
-
isVisible
public boolean isVisible()
WRepeatRoot is part of the tree, but we don't want any request handling or painting to be performed on it automatically.- Specified by:
isVisible
in interfaceWComponent
- Overrides:
isVisible
in classAbstractWComponent
- Returns:
- false
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfaceContainer
- Returns:
- the number of child components currently contained within this component.
-
getChildAt
public WComponent getChildAt(int index)
Retrieves a child component by its index.- Specified by:
getChildAt
in interfaceContainer
- Parameters:
index
- the index of the child component to be retrieved.- Returns:
- the child component at the given index.
-
getChildren
public List<WComponent> getChildren()
Retrieves a list of this Container's.- Specified by:
getChildren
in interfaceContainer
- Returns:
- an immutable list of this Container.
-
getIndexOfChild
public int getIndexOfChild(WComponent childComponent)
Retrieves the index of the given child.- Specified by:
getIndexOfChild
in interfaceContainer
- Parameters:
childComponent
- the child component to retrieve the index for.- Returns:
- the index of the given child component, or -1 if the component is not a child of this component.
-
isNamingContext
public boolean isNamingContext()
A naming context is only considered active if an Id name has been set.- Specified by:
isNamingContext
in interfaceNamingContextable
- Returns:
- true if active naming context.
-
getNamingContextId
public String getNamingContextId()
Allow components that implementNamingContextable
to selectively disable prepending their ID to their descendent's IDs by breaking the prepending logic into a seperately callable method.See
WComponent.getId()
for usage.By default, this method will call through to
WComponent.getId()
and return the result.- Specified by:
getNamingContextId
in interfaceNamingContextable
- Returns:
- by default, return getId().
-
-