com.ibm.xsp.component
Class UIDataEx

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIData
              extended by com.ibm.xsp.component.UIDataEx
All Implemented Interfaces:
FacesAjaxComponent, FacesDataIterator, FacesRefreshableComponent, FacesRowIndex, ThemeControl, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
UIDataTable, UIFileDownload, UIViewPanel

public class UIDataEx
extends javax.faces.component.UIData
implements FacesDataIterator, FacesRefreshableComponent, FacesAjaxComponent, ThemeControl

Extends UIData to delegate to ApplicationEx.createDataModel(Object) to create the data model, and adds other functionalities needed by the Data Table and View Panel controls.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponentBase
javax.faces.component.UIComponentBase.AggregatedIterator, javax.faces.component.UIComponentBase.UnmodifiableIterator
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponent
javax.faces.component.UIComponent.StateMap, javax.faces.component.UIComponent.StateMapEntry
 
Field Summary
static java.lang.String AJAX_GETROWS
           
static java.lang.String COMPONENT_TYPE
           
static int DEFAULT_ROWS_PER_PAGE
          This is a default value that will be applied if "rows" is not set or is less than 1
static java.lang.String TOGGLE_ACTION_CLIENT_ID
          This is the key of a value stored in the attributes map and not a clientId suffix, nor is it an actual clientId.
 
Fields inherited from class javax.faces.component.UIData
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UIDataEx()
           
 
Method Summary
 void _xspCleanTransientData()
           
 void broadcast(javax.faces.event.FacesEvent event)
           
protected  java.lang.String computeDataModelKey()
          Computes Data model key based on parent DataIterators.
protected  javax.faces.model.DataModel createDataModel()
          Available to be extended by subclasses.
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 java.lang.String getAjaxUrl(javax.faces.context.FacesContext context, java.lang.String verb)
          Compose the URL for a Ajax request related to a component; generally the AJAX_GETROWS would be passed in as the verb.
 java.lang.String getAjaxUrl(java.lang.String verb)
          Compose the URL for a Ajax request related to a component; generally the AJAX_GETROWS would be passed in as the verb.
 DataSource getData()
          returns the DataSource for this control.
 javax.faces.model.DataModel getDataModel()
          Create a data model from the value using the data model factory method on the application instance.
 DataSource getDataSource()
           
 java.lang.String getIndexVar()
           
 javax.faces.model.DataModel getLastCreatedDataModel()
          Deprecated.  
 java.lang.String getNonChildClientId(javax.faces.context.FacesContext context)
           
 java.lang.String getRefreshId()
           
 int getRowCount()
           
 int getRowCount(int maxCount)
           
 int getRows()
           
 java.lang.String getStyleKitFamily()
          The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source.
 java.lang.Object getValue()
           
protected  int getZeroRows(int rows)
           
 boolean gotoFirstPage()
          Go to the first page in the data control.
 boolean gotoLastPage()
          Go to the last page in the data control.
 boolean gotoNextPage()
          Go to the next page in the data control.
 boolean gotoPage(int page)
          Go to the specified page in the data control.
 boolean gotoPreviousPage()
          Go to the previous page in the data control.
 boolean gotoRow(int row)
          Go to the specified row in the data control.
 boolean handles(javax.faces.context.FacesContext context)
          This FacesAjaxComponent implementation returns false as it requires the context of the surrounding XPage, instead of directly handling the response without data from data sources or other variables in the XPage.
 boolean invokeOnComponent(javax.faces.context.FacesContext context, java.lang.String clientId, javax.faces.component.ContextCallback callback)
           
protected  boolean isNestedInDataIterator()
           
 boolean isPartialExecute()
           
 boolean isPartialRefresh()
           
protected  void processAjaxGetRows(javax.faces.context.FacesContext context)
           
 void processAjaxRequest(javax.faces.context.FacesContext context)
          This FacesAjaxComponent implementation handles non-partial-update AJAX requests where the XPage name is like /page1.xsp/getrows, that is, where the path info ( ExternalContext.getRequestPathInfo() begins with AJAX_GETROWS.
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
protected  java.util.List<DataPublisher.ShadowedObject> publishControlData(javax.faces.context.FacesContext context)
          This publishes 1)the data source object, 2) the current item being repeated through and 3) the index of the item, to be available as variables in the request scope, so they may be used by computed values within this repeating control.
 void queueEvent(javax.faces.event.FacesEvent event)
           
protected  void resetDataModel()
          resets data model
protected  java.lang.Object resolveValue()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
protected  void revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowed, javax.faces.context.FacesContext context)
          Revokes the values published in publishControlData(FacesContext), removing them from the request scope.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setData(DataSource data)
          Sets the DataSource for this control.
protected  void setDataModel(javax.faces.model.DataModel dataModel)
           
 void setIndexVar(java.lang.String indexVar)
          The var set on this control can then be used by children to reference the data defined on the UIData Control.
 void setRowIndex(int index)
           
 void setRows(int rows)
           
 void setValue(java.lang.Object value)
           
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
           
 void setVar(java.lang.String var)
           
 boolean visitTree(javax.faces.component.visit.VisitContext context, javax.faces.component.visit.VisitCallback callback)
           
 
Methods inherited from class javax.faces.component.UIData
getClientId, getFamily, getFirst, getFooter, getHeader, getRowData, getRowIndex, getVar, isRowAvailable, setFirst, setFooter, setHeader
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, isVisitable, markInitialState, setControlState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.component.FacesDataIterator
getFirst, getRowIndex, setFirst
 

Field Detail

DEFAULT_ROWS_PER_PAGE

public static final int DEFAULT_ROWS_PER_PAGE
This is a default value that will be applied if "rows" is not set or is less than 1

See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

TOGGLE_ACTION_CLIENT_ID

public static final java.lang.String TOGGLE_ACTION_CLIENT_ID
This is the key of a value stored in the attributes map and not a clientId suffix, nor is it an actual clientId. It is used to maintain the currently focussed category link within a View Panel during partial refresh expand/collapse interactions.

See Also:
Constant Field Values

AJAX_GETROWS

public static final java.lang.String AJAX_GETROWS
See Also:
processAjaxRequest(FacesContext), Constant Field Values
Constructor Detail

UIDataEx

public UIDataEx()
Method Detail

getStyleKitFamily

public java.lang.String getStyleKitFamily()
Description copied from interface: ThemeControl
The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source. For example, "InputField.EditBox" is used for most Edit Box controls. See Domino/xsp/nsf/themes/webstandard.theme for more examples.

The implementation may return different values depending on the configuration of the current control, for example the Button control returns a different value and looks different when it is configured as a cancel button.

Specified by:
getStyleKitFamily in interface ThemeControl
Returns:
a non-null themeId corresponding to the configuration for this type of control in a theme file.

_xspCleanTransientData

public void _xspCleanTransientData()
Overrides:
_xspCleanTransientData in class javax.faces.component.UIComponentBase

isPartialRefresh

public boolean isPartialRefresh()

getRefreshId

public java.lang.String getRefreshId()

isPartialExecute

public boolean isPartialExecute()

getDataModel

public javax.faces.model.DataModel getDataModel()
Create a data model from the value using the data model factory method on the application instance. The data model is cached using a transient member variable so that it can be retrieved later.

Specified by:
getDataModel in interface FacesDataIterator
Overrides:
getDataModel in class javax.faces.component.UIData

getLastCreatedDataModel

public javax.faces.model.DataModel getLastCreatedDataModel()
Deprecated. 


setDataModel

protected void setDataModel(javax.faces.model.DataModel dataModel)
Overrides:
setDataModel in class javax.faces.component.UIData

createDataModel

protected javax.faces.model.DataModel createDataModel()
Available to be extended by subclasses.

Returns:

computeDataModelKey

protected java.lang.String computeDataModelKey()
Computes Data model key based on parent DataIterators.

Returns:

resetDataModel

protected void resetDataModel()
resets data model


isNestedInDataIterator

protected boolean isNestedInDataIterator()

setData

public void setData(DataSource data)
Sets the DataSource for this control.

Parameters:
data -

getData

public DataSource getData()
returns the DataSource for this control.

Returns:

getDataSource

public DataSource getDataSource()

setIndexVar

public void setIndexVar(java.lang.String indexVar)
The var set on this control can then be used by children to reference the data defined on the UIData Control.

Parameters:
indexVar - The index var to set.

getIndexVar

public java.lang.String getIndexVar()
Returns:
Returns the index var.

getValue

public java.lang.Object getValue()
Overrides:
getValue in class javax.faces.component.UIData

resolveValue

protected java.lang.Object resolveValue()

setRowIndex

public void setRowIndex(int index)
Overrides:
setRowIndex in class javax.faces.component.UIData

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.component.UIData
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

getRowCount

public int getRowCount()
Overrides:
getRowCount in class javax.faces.component.UIData

getRowCount

public int getRowCount(int maxCount)

getRows

public int getRows()
Specified by:
getRows in interface FacesDataIterator
Overrides:
getRows in class javax.faces.component.UIData

getZeroRows

protected int getZeroRows(int rows)

setRows

public void setRows(int rows)
Specified by:
setRows in interface FacesDataIterator
Overrides:
setRows in class javax.faces.component.UIData

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIData

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIData

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIData

invokeOnComponent

public boolean invokeOnComponent(javax.faces.context.FacesContext context,
                                 java.lang.String clientId,
                                 javax.faces.component.ContextCallback callback)
                          throws javax.faces.FacesException
Overrides:
invokeOnComponent in class javax.faces.component.UIData
Throws:
javax.faces.FacesException

visitTree

public boolean visitTree(javax.faces.component.visit.VisitContext context,
                         javax.faces.component.visit.VisitCallback callback)
Overrides:
visitTree in class javax.faces.component.UIData

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UIData

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class javax.faces.component.UIData
Throws:
javax.faces.event.AbortProcessingException

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIData

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIData

setValue

public void setValue(java.lang.Object value)
Overrides:
setValue in class javax.faces.component.UIData

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)
Overrides:
setValueBinding in class javax.faces.component.UIData

setVar

public void setVar(java.lang.String var)
Overrides:
setVar in class javax.faces.component.UIData

gotoFirstPage

public boolean gotoFirstPage()
Go to the first page in the data control.

Returns:

gotoPreviousPage

public boolean gotoPreviousPage()
Go to the previous page in the data control.

Returns:

gotoNextPage

public boolean gotoNextPage()
Go to the next page in the data control.

Returns:

gotoLastPage

public boolean gotoLastPage()
Go to the last page in the data control.

Returns:

gotoRow

public boolean gotoRow(int row)
Go to the specified row in the data control.

Returns:

gotoPage

public boolean gotoPage(int page)
Go to the specified page in the data control.

Returns:

publishControlData

protected java.util.List<DataPublisher.ShadowedObject> publishControlData(javax.faces.context.FacesContext context)
This publishes 1)the data source object, 2) the current item being repeated through and 3) the index of the item, to be available as variables in the request scope, so they may be used by computed values within this repeating control. The current item, from the list that is being repeated over, is published under the name from UIData.getVar(), and the current item index is published under the name from getIndexVar(). Note, this control is not a FacesDataProvider, publishing a list of data sources, as only a single data source may be configured.

Parameters:
context -
Returns:
See Also:
for general discussion of publish and revoke.

revokeControlData

protected void revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowed,
                                 javax.faces.context.FacesContext context)
Revokes the values published in publishControlData(FacesContext), removing them from the request scope.

Parameters:
shadowed -
context -

getNonChildClientId

public java.lang.String getNonChildClientId(javax.faces.context.FacesContext context)
Specified by:
getNonChildClientId in interface FacesRefreshableComponent
Returns:
See Also:
FacesRefreshableComponent.getNonChildClientId(javax.faces.context.FacesContext)

getAjaxUrl

public java.lang.String getAjaxUrl(java.lang.String verb)
Compose the URL for a Ajax request related to a component; generally the AJAX_GETROWS would be passed in as the verb.


getAjaxUrl

public java.lang.String getAjaxUrl(javax.faces.context.FacesContext context,
                                   java.lang.String verb)
Compose the URL for a Ajax request related to a component; generally the AJAX_GETROWS would be passed in as the verb.


handles

public boolean handles(javax.faces.context.FacesContext context)
This FacesAjaxComponent implementation returns false as it requires the context of the surrounding XPage, instead of directly handling the response without data from data sources or other variables in the XPage.

Specified by:
handles in interface FacesAjaxComponent
Returns:
true if request handler
See Also:
FacesAjaxComponent.handles(FacesContext)

processAjaxRequest

public void processAjaxRequest(javax.faces.context.FacesContext context)
                        throws java.io.IOException
This FacesAjaxComponent implementation handles non-partial-update AJAX requests where the XPage name is like /page1.xsp/getrows, that is, where the path info ( ExternalContext.getRequestPathInfo() begins with AJAX_GETROWS. For such a request, the rows portion of the control's HTML output is returned to the browser, without the TABLE tag or similar headers normally output by this control.

Specified by:
processAjaxRequest in interface FacesAjaxComponent
Throws:
java.io.IOException
See Also:
FacesAjaxComponent.processAjaxRequest(FacesContext)

processAjaxGetRows

protected void processAjaxGetRows(javax.faces.context.FacesContext context)
                           throws java.io.IOException
Throws:
java.io.IOException