com.ibm.bpe.jsf.handler
Class BPCListHandler
- java.lang.Object
com.ibm.bpe.jsf.handler.BPCListHandler
All implemented interfaces:
- public class BPCListHandler
- extends java.lang.Object
- implements ItemProvider, ErrorHandler
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 |
---|---|
|
ATTRIBUTE_FOR_SORTING
The name of the component attribute that determines which row
is used when sorting the results.
|
|
COPYRIGHT
|
Constructor Summary
Constructor and Description |
---|
BPCListHandler()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addItemListener(ItemListener listener)
Adds a new
ItemListener object to the list of ItemListener objects.
|
|
clearSelection()
Resets the selection of the associated list to 'none'.
|
|
executeQuery()
Triggers execution of the associated query.
|
|
getErrors()
Returns the errors map for items in the list.
|
|
getItem()
Returns the currently selected item.
|
|
getItemListener()
Returns a list of all registered
ItemListener objects.
|
|
getItems()
Returns a list of all the items retrieved by running the associated query.
|
|
getName()
Returnes the list name.
|
|
getNotEmpty()
|
|
getPagingHelper()
The returned class is not for public use.
|
getQuery()
Returns the registered query object.
|
|
getQueryMessage()
Returns message indication problems that occurred during execution of the query.
|
|
|
getSelectedItems()
Returns all selected items in the list.
|
|
getSelectionHelper()
The returned class is not for public use.
|
|
getSortHelper()
The returned class is not for public use.
|
|
getType()
Returns the expected type of the query model.
|
|
refreshList()
Triggers a refresh of the list by executing the associated query.
|
|
refreshList(boolean clearErrors)
Triggers a refresh of the list by executing the associated query.
|
|
setErrors(java.util.Map errors)
Sets the errors map for this instance.
|
|
setItemListener(java.util.List list)
Sets the list of
ItemListener objects.
|
|
setName(java.lang.String name)
Sets the list name.
|
|
setQuery(Query newQuery)
Sets the query used to retrieve the list of items.
|
|
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
COPYRIGHT
- public static final java.lang.String COPYRIGHT
See Also:
ATTRIBUTE_FOR_SORTING
- public static final java.lang.String ATTRIBUTE_FOR_SORTING
See Also:
Constructor Detail
BPCListHandler
- public BPCListHandler()
Method Detail
clearSelection
- public void clearSelection()
Resets the selection of the associated list to 'none'.
getItems
- 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
- 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
- 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
- public java.lang.String executeQuery( )
- throws ClientException
Triggers execution of the associated query. Passes exceptions so that the
caller can perform error handling. The error map is not touched.
setQuery
- 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
- public Query getQuery()
Returns the registered query object.
Returns:
the query used to retrieve the list of items.
getName
- public java.lang.String getName( )
Returnes the list name.
setName
- public void setName(java.lang.String name)
Sets the list name.
setType
- 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
- public java.lang.String getType( )
Returns the expected type of the query model.
Returns:
The model type
getItem
- 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
- 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:
getSelectedItems
in interface ItemProvider
Returns:
List of selected items
getItemListener
- public java.util.List getItemListener( )
Returns a list of all registered
ItemListener
objects.
Returns:
List of ItemListener
setItemListener
- 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
- public void addItemListener(ItemListener listener)
Adds a new
ItemListener
object to the list of ItemListener
objects.
Parameters:
listener
- An ItemListener getErrors
- 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
- 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
- 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
- public com.ibm.bpe.jsf.handler.BPCListHandlerPagingHelper getPagingHelper( )
The returned class is not for public use.
getSelectionHelper
- public com.ibm.bpe.jsf.handler.BPCListHandlerSelectionHelper getSelectionHelper( )
The returned class is not for public use.
getSortHelper
- public com.ibm.bpe.jsf.handler.BPCListHandlerSortHelper getSortHelper( )
The returned class is not for public use.
getNotEmpty
- public boolean getNotEmpty()
sortBy(ActionEvent)
.