com.ibm.bpe.jsf.handler

Class BPCListHandler

  1. java.lang.Object
  2. extended bycom.ibm.bpe.jsf.handler.BPCListHandler
All implemented interfaces:
ErrorHandler, ItemProvider

  1. public class BPCListHandler
  2. extends java.lang.Object
  3. implements ItemProvider, ErrorHandler
This class can be used as a Faces Managed Bean that provides the data to be displayed in a List Component. In order to associate a Managed Bean of type BPCListHandler with a List Component on a page, the Value Binding Expression of the list tag must be targeted at the Managed Bean. For more information about the List Component, see ListTag. The BPCListHandler class generates Item Changed events whenever an item in the associated List Component is selected. The ItemListener can be registered on the BPCListHandler using the ItemListener property. For more information about using the ItemListener interface, see the example shown in ItemListener.

Example:
 
  
   
   <managed-bean>
   <managed-bean-name>ProcessInstanceList</managed-bean-name>
   <managed-bean-class>com.ibm.bpe.jsf.handler.BPCListHandler</managed-bean-class>
   <managed-bean-scope>session</managed-bean-scope>
   <managed-property>
   <property-name>type</property-name>
   <value>com.ibm.bpe.client.model.ProcessInstanceBean</value>
   </managed-property>
   <managed-property>
   <property-name>itemListener</property-name>
   <list-entries>
   <value-class>com.ibm.bpe.jsf.handler.ItemListener</value-class>
   <value>#{ProcessInstanceDetailsBean}</value>
   </list-entries>
   </managed-property>
   <managed-property>
   <property-name>query</property-name>
   <value>#{ProcessInstanceQuery}</value>
   </managed-property>
   </managed-bean>
   
   
   
  
 
The specified type enables Components to retrieve metadata about the model objects that are accessed through the BPCDetailsHandler instance.

Example of how to use a BPCListComponent instance as a model of a ListComponent:
 
  
   
   <bpe:list model="#{ProcessInstanceList}" rows="5" styleClass="list" headerStyleClass="listHeader" rowClasses="normal">
   <bpe:column name="name" action="processInstanceDetails" />
   <bpe:column name="processTemplateName" action="processTemplateDetails" />
   <bpe:column name="executionState" />
   <bpe:column name="startTime" />
   </bpe:list>
   
   
  
 

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
ATTRIBUTE_FOR_SORTING
The name of the component attribute that determines which row is used when sorting the results.
  1. static
  2. java.lang.String
COPYRIGHT

Constructor Summary

Constructor and Description
BPCListHandler()

Method Summary

Modifier and Type Method and Description
  1. void
addItemListener(ItemListener listener)
Adds a new ItemListener object to the list of ItemListener objects.
  1. void
clearSelection()
Resets the selection of the associated list to 'none'.
  1. java.lang.String
executeQuery()
Triggers execution of the associated query.
  1. java.util.Map
getErrors()
Returns the errors map for items in the list.
  1. java.lang.Object
getItem()
Returns the currently selected item.
  1. java.util.List
getItemListener()
Returns a list of all registered ItemListener objects.
  1. java.util.List
getItems()
Returns a list of all the items retrieved by running the associated query.
  1. java.lang.String
getName()
Returnes the list name.
  1. boolean
getNotEmpty()
  1. com.ibm.bpe.jsf.handler.BPCListHandlerPagingHelper
getPagingHelper()
The returned class is not for public use.
  1. Query
getQuery()
Returns the registered query object.
  1. Message
getQueryMessage()
Returns message indication problems that occurred during execution of the query.
  1. java.util.List
getSelectedItems()
Returns all selected items in the list.
  1. com.ibm.bpe.jsf.handler.BPCListHandlerSelectionHelper
getSelectionHelper()
The returned class is not for public use.
  1. com.ibm.bpe.jsf.handler.BPCListHandlerSortHelper
getSortHelper()
The returned class is not for public use.
  1. java.lang.String
getType()
Returns the expected type of the query model.
  1. java.lang.String
refreshList()
Triggers a refresh of the list by executing the associated query.
  1. java.lang.String
refreshList(boolean clearErrors)
Triggers a refresh of the list by executing the associated query.
  1. void
setErrors(java.util.Map errors)
Sets the errors map for this instance.
  1. void
setItemListener(java.util.List list)
Sets the list of ItemListener objects.
  1. void
setName(java.lang.String name)
Sets the list name.
  1. void
setQuery(Query newQuery)
Sets the query used to retrieve the list of items.
  1. void
setType(java.lang.String typeName)
Sets the type of the BPCListHandler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

  1. public static final java.lang.String COPYRIGHT
See Also:

ATTRIBUTE_FOR_SORTING

  1. public static final java.lang.String ATTRIBUTE_FOR_SORTING
The name of the component attribute that determines which row is used when sorting the results. Sorting is triggered by the Command Listener Method sortBy(ActionEvent).
See Also:

Constructor Detail

BPCListHandler

  1. public BPCListHandler()

Method Detail

clearSelection

  1. public void clearSelection()
Resets the selection of the associated list to 'none'.

getItems

  1. public java.util.List getItems( )
Returns a list of all the items retrieved by running the associated query.
Returns:
List of all items retrieved by the associated query

refreshList

  1. public java.lang.String refreshList( boolean clearErrors)
Triggers a refresh of the list by executing the associated query. The method uses a Faces Action Method.
Returns:
null stay on this page.

refreshList

  1. public java.lang.String refreshList( )
Triggers a refresh of the list by executing the associated query. The method uses a Faces Action Method. The error map is cleared automatically.
Returns:
null stay on this page.

executeQuery

  1. public java.lang.String executeQuery( )
  2. throws ClientException
Triggers execution of the associated query. Passes exceptions so that the caller can perform error handling. The error map is not touched.
Returns:
null stay on this page.
Throws:

setQuery

  1. public void setQuery(Query newQuery)
Sets the query used to retrieve the list of items. If both the 'type' property of the BPCListHandler and the 'type' property of the query are set, an assertion is thrown if they differ.
Parameters:
newQuery - The query used to retrieve the model

getQuery

  1. public Query getQuery()
Returns the registered query object.
Returns:
the query used to retrieve the list of items.

getName

  1. public java.lang.String getName( )
Returnes the list name.

setName

  1. public void setName(java.lang.String name)
Sets the list name.

setType

  1. public void setType(java.lang.String typeName)
Sets the type of the BPCListHandler. If both the 'type' property of the BPCListHandler and the 'type' property of the query are set, an assertion is thrown if they differ. This property is optional.
Parameters:
typeName - The model type

getType

  1. public java.lang.String getType( )
Returns the expected type of the query model.
Returns:
The model type

getItem

  1. public java.lang.Object getItem( )
Returns the currently selected item. This method could be called as a result of an action method that is referenced using the action attribute of the ColumnTag. If called in any other context, the item might no longer be valid.
Returns:
the currently selected item.

getSelectedItems

  1. public java.util.List getSelectedItems( )
Returns all selected items in the list. In contrast to the getItem method, this method returns all items for which checkboxes in the list are selected (getItem returns the single item that has been selected by clicking on its link in the associated list).
Specified by:
Returns:
List of selected items

getItemListener

  1. public java.util.List getItemListener( )
Returns a list of all registered ItemListener objects.
Returns:
List of ItemListener

setItemListener

  1. public void setItemListener(java.util.List list)
Sets the list of ItemListener objects. For example, this method is called if ItemListeners are specified as the managed-bean-property of a BPCListHandler instance in a faces configuration file. It overwrites any ItemListener objects that have been set using the addItemListener method.
Parameters:
list - The list of ItemListener objects

addItemListener

  1. public void addItemListener(ItemListener listener)
Adds a new ItemListener object to the list of ItemListener objects.
Parameters:
listener - An ItemListener

getErrors

  1. public java.util.Map getErrors( )
Returns the errors map for items in the list. If errors for items in the list have been registered, the error messages are displayed in the associated List Component.
Specified by:
getErrors in interface ErrorHandler
Returns:
The errors that occurred while processing commands

setErrors

  1. public void setErrors(java.util.Map errors)
Sets the errors map for this instance. If errors for items in the list have been registerd, they are displayed by the DetailsComponent.
Specified by:
setErrors in interface ErrorHandler
Parameters:
errors - The errors that occurred while processing commands

getQueryMessage

  1. public Message getQueryMessage( )
Returns message indication problems that occurred during execution of the query. This method can be used to obtain more information about why a query returned no data.
Returns:
The Message

getPagingHelper

  1. public com.ibm.bpe.jsf.handler.BPCListHandlerPagingHelper getPagingHelper( )
The returned class is not for public use.

getSelectionHelper

  1. public com.ibm.bpe.jsf.handler.BPCListHandlerSelectionHelper getSelectionHelper( )
The returned class is not for public use.

getSortHelper

  1. public com.ibm.bpe.jsf.handler.BPCListHandlerSortHelper getSortHelper( )
The returned class is not for public use.

getNotEmpty

  1. public boolean getNotEmpty()