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 ObjectgetBean(BeanProviderBound beanProviderBound)WRepeatRoot will act as a provider for a provider bound repeated component.WComponentgetChildAt(int index)Retrieves a child component by its index.intgetChildCount()List<WComponent>getChildren()Retrieves a list of this Container's.StringgetId()Return an identifier for this component, generating one if necessary.StringgetIdName()Override WComponent name to include a row index.intgetIndexOfChild(WComponent childComponent)Retrieves the index of the given child.StringgetInternalId()Override WComponent internal id to include a row index.StringgetNamingContextId()Allow components that implementNamingContextableto selectively disable prepending their ID to their descendent's IDs by breaking the prepending logic into a seperately callable method.WComponentgetRepeatedComponent()booleanisNamingContext()A naming context is only considered active if an Id name has been set.booleanisVisible()WRepeatRoot is part of the tree, but we don't want any request handling or painting to be performed on it automatically.voidsetData(Object rowData)Override setData in order to push data to non-BeanProviderBoundrenderers 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:
getBeanin 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-BeanProviderBoundrenderers each time the data is changed.- Specified by:
setDatain interfaceDataBound- Overrides:
setDatain classWBeanComponent- Parameters:
rowData- the data for this row.
-
getInternalId
public String getInternalId()
Override WComponent internal id to include a row index.- Specified by:
getInternalIdin interfaceWComponent- Overrides:
getInternalIdin 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_SEPERATORif the parent is an active NamingContext. Then let the ID be prefix + generate unique id.
- Specified by:
getIdin interfaceWComponent- Specified by:
getIdin interfaceWebComponent- Overrides:
getIdin 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:
getIdNamein interfaceWComponent- Overrides:
getIdNamein 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:
isVisiblein interfaceWComponent- Overrides:
isVisiblein classAbstractWComponent- Returns:
- false
-
getChildCount
public int getChildCount()
- Specified by:
getChildCountin 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:
getChildAtin 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:
getChildrenin interfaceContainer- Returns:
- an immutable list of this Container.
-
getIndexOfChild
public int getIndexOfChild(WComponent childComponent)
Retrieves the index of the given child.- Specified by:
getIndexOfChildin 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:
isNamingContextin interfaceNamingContextable- Returns:
- true if active naming context.
-
getNamingContextId
public String getNamingContextId()
Allow components that implementNamingContextableto 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:
getNamingContextIdin interfaceNamingContextable- Returns:
- by default, return getId().
-
-