Class WTable.TableRepeater
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.WRepeater
-
- com.github.bordertech.wcomponents.WTable.TableRepeater
-
- All Implemented Interfaces:
AjaxTarget,BeanAware,BeanBound,BeanProviderBound,Container,DataBound,NamingContextable,WComponent,WebComponent,Serializable
- Enclosing class:
- WTable
public static class WTable.TableRepeater extends WRepeater
This repeater extension is necessary to ensure that tree-tables are painted correctly.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.WRepeater
WRepeater.RepeaterModel, WRepeater.SubUIContext, WRepeater.WRepeatRoot
-
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 TableRepeater(WTable table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanupStaleContexts(Set<?> rowIds)Removes any stale contexts from the row context map.List<WTable.RowIdWrapper>getBeanList()Retrieves the list of dataBeans that holds the data object for each row.StringgetId()Return an identifier for this component, generating one if necessary.protected StringgetRowIdName(Object rowBean, Object rowId)Allows a subclass to provide the ID used in the row naming context.protected voidpaintComponent(RenderContext renderContext)Override paintComponent, as the table renderer does all the work.-
Methods inherited from class com.github.bordertech.wcomponents.WRepeater
clearScratchMaps, getChildAt, getChildCount, getChildren, getComponentModel, getIndexOfChild, getNamingContextId, getOrCreateComponentModel, getRepeatedComponent, getRepeatedComponent, getRepeatRoot, getRowBeanForSubcontext, getRowContext, getRowContext, getRowContexts, getRowId, handleRequest, isNamingContext, newComponentModel, preparePaintComponent, prepareRow, setBeanList, setData, setNamingContext, setRepeatedComponent, setRowIdProperty, showErrorIndicators, tidyUpUIContext, toString, updateBeanValue, validate
-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, getData, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setSearchAncestors
-
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, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContextForTree, 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, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showWarningIndicators, tidyUpUIContextForTree
-
-
-
-
Constructor Detail
-
TableRepeater
public TableRepeater(WTable table)
- Parameters:
table- the parent table.
-
-
Method Detail
-
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
-
paintComponent
protected void paintComponent(RenderContext renderContext)
Override paintComponent, as the table renderer does all the work.- Overrides:
paintComponentin classAbstractWComponent- Parameters:
renderContext- the RenderContext to send output to.
-
getBeanList
public List<WTable.RowIdWrapper> getBeanList()
Retrieves the list of dataBeans that holds the data object for each row. The list returned will be the same instance as the one supplied via the setBeanList method. Will never return null, but it can return an empty list.- Overrides:
getBeanListin classWRepeater- Returns:
- the list of dataBeans that holds the data object for each row
-
cleanupStaleContexts
protected void cleanupStaleContexts(Set<?> rowIds)
Removes any stale contexts from the row context map.- Overrides:
cleanupStaleContextsin classWRepeater- Parameters:
rowIds- the current set of row Ids.
-
getRowIdName
protected String getRowIdName(Object rowBean, Object rowId)
Allows a subclass to provide the ID used in the row naming context.The returned ID must only contain letters, digits or underscores.
- Overrides:
getRowIdNamein classWRepeater- Parameters:
rowBean- the row's beanrowId- the row id- Returns:
- the unique row id or null to use the row context id
-
-