org.jaffa.components.lookup
Class LookupComponent2

java.lang.Object
  extended byorg.jaffa.presentation.portlet.component.Component
      extended byorg.jaffa.components.finder.FinderComponent2
          extended byorg.jaffa.components.lookup.LookupComponent2
All Implemented Interfaces:
IComponent

public abstract class LookupComponent2
extends FinderComponent2

This is the base class for all Lookup components. It inherits the properties from FinderComponent. Additionally it has the following properties - 1- targetFields : This will have the target-fields to be set based on the selected values from the Lookup. 2- multiSelectLookupListeners : This will maintain the listeners to be notified when row(s) are selected in the Lookup. It has a convenience method, which should be called by the component's Action class to forward to the generic lookup jsp.

Author:
GautamJ

Field Summary
static String LOOKUP_ATTRIBUTE
          A constant used to pass the selected values to the Http Request stream.
static String MULTI_SELECT_CHECKBOX
          A constant used to store the CheckBoxModel for each row in the GridModel in the FormBean.
 
Fields inherited from class org.jaffa.components.finder.FinderComponent2
ATTRIBUTE_EXPORT_TYPE_XML, EXPORT_TYPE_EXCEL, EXPORT_TYPE_WEB_PAGE, EXPORT_TYPE_XML
 
Constructor Summary
LookupComponent2()
           
 
Method Summary
 void addMultiSelectLookupListener(IMultiSelectLookupListener listener)
          Adds a listener.
protected  String getExcelFormName()
          This returns a null, since the Lookup components are not expected to serve up Excel content.
protected  Collection getMultiSelectLookupListeners()
          Returns a Collection of IMultiSelectLookupListener objects.
 String getTargetFields()
          Getter for property targetFields.
protected  String getXmlFormName()
          This returns a null, since the Lookup components are not expected to serve up XML content.
protected  void invokeMultiSelectLookupListeners(MultiSelectLookupEvent event)
          Invokes the rowsSelected() method of the registered IMultiSelectLookupListener objects in the same thread.
 boolean isInMultiSelectLookupMode()
          Returns a true if a MultiSelectLookupListener has been registered with this Lookup.
 FormKey performLookup(HttpServletRequest request, IModelMap selectedRow)
          This will add the 'lookup' attribute on the request stream, with a Map containing the fieldnames (from the targetFields property) and values (from the input selectedRow).
 FormKey performLookup(HttpServletRequest request, Map selectedRow)
          This will add the 'lookup' attribute on the request stream, with a Map containing the fieldnames (from the targetFields property) and values (from the input selectedRow).
 FormKey performMultiSelectLookup(HttpServletRequest request, MultiSelectLookupEvent event)
          Invokes the rowsSelected() method of the registered IMultiSelectLookupListener objects in the same thread.
 void quit()
          This clears the internal collection of listeners.
 FormKey quitLookup(HttpServletRequest request)
          This will remove the 'lookup' attribute from the request stream.
 boolean removeMultiSelectLookupListener(IMultiSelectLookupListener listener)
          Removes a listener.
 void setTargetFields(String targetFields)
          Setter for property targetFields.
 
Methods inherited from class org.jaffa.components.finder.FinderComponent2
addSortCriteria, display, displayCriteria, displayResults, doInquiry, getConsolidatedCriteriaAndResults, getConsolidatedCriteriaAndResultsFormName, getCriteriaFormKey, getCriteriaFormName, getDisplayResultsScreen, getExportType, getFinderOutDto, getHeaderDto, getMaxRecords, getResultsFormKey, getResultsFormName, getSortDropDown, incrementMaxRecords, initializeCriteriaScreen, performInquiry, setConsolidatedCriteriaAndResults, setDisplayResultsScreen, setExportType, setMaxRecords, setSortDropDown, uncacheRowsModel, updateMaxRecordsModel
 
Methods inherited from class org.jaffa.presentation.portlet.component.Component
addChildComponent, addFormKeyChangeListener, getComponentDefinition, getComponentId, getContainerFormKey, getFormKeyChangeListeners, getReturnToFormKey, getToken, getUserSession, isActive, quitAndReturnToCallingScreen, reflectAndSetParms, removeFormKeyChangeListener, returnChildComponents, returnLastActivityDate, run, setContainerFormKey, setReturnToFormKey, setToken, updateLastActivityDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOOKUP_ATTRIBUTE

public static final String LOOKUP_ATTRIBUTE
A constant used to pass the selected values to the Http Request stream.

See Also:
Constant Field Values

MULTI_SELECT_CHECKBOX

public static final String MULTI_SELECT_CHECKBOX
A constant used to store the CheckBoxModel for each row in the GridModel in the FormBean.

See Also:
Constant Field Values
Constructor Detail

LookupComponent2

public LookupComponent2()
Method Detail

getTargetFields

public String getTargetFields()
Getter for property targetFields.

Returns:
Value of property targetFields.

setTargetFields

public void setTargetFields(String targetFields)
Setter for property targetFields.

Parameters:
targetFields - New value of property targetFields.

addMultiSelectLookupListener

public void addMultiSelectLookupListener(IMultiSelectLookupListener listener)
Adds a listener.

Parameters:
listener - the listener.

removeMultiSelectLookupListener

public boolean removeMultiSelectLookupListener(IMultiSelectLookupListener listener)
Removes a listener.

Parameters:
listener - the listener.
Returns:
true if the listener was removed.

isInMultiSelectLookupMode

public boolean isInMultiSelectLookupMode()
Returns a true if a MultiSelectLookupListener has been registered with this Lookup. The associated JSP will use this method to determine if multi-select capability is to be presented to the user.

Returns:
true if a MultiSelectLookupListener has been registered with this Lookup.

getExcelFormName

protected String getExcelFormName()
This returns a null, since the Lookup components are not expected to serve up Excel content.

Specified by:
getExcelFormName in class FinderComponent2
Returns:
null.

getXmlFormName

protected String getXmlFormName()
This returns a null, since the Lookup components are not expected to serve up XML content.

Specified by:
getXmlFormName in class FinderComponent2
Returns:
null.

quit

public void quit()
This clears the internal collection of listeners. It then invokes the quit() method of the base class.

Specified by:
quit in interface IComponent
Overrides:
quit in class Component

quitLookup

public FormKey quitLookup(HttpServletRequest request)
This will remove the 'lookup' attribute from the request stream. It will then invoke the quitAndReturnToCallingScreen() method, if MultiSelectLookupListener was registered. Otherwise it will quit() and return a FormKey object for the generic lookup jsp, which will close the browser.

Parameters:
request - The HTTP request we are processing
Returns:
a FormKey object.

performMultiSelectLookup

public FormKey performMultiSelectLookup(HttpServletRequest request,
                                        MultiSelectLookupEvent event)
Invokes the rowsSelected() method of the registered IMultiSelectLookupListener objects in the same thread. It will then invoke the quitLookup() method.

Parameters:
request - The HTTP request we are processing
event - The event object containing the row(s) selected.
Returns:
a FormKey object.

performLookup

public FormKey performLookup(HttpServletRequest request,
                             IModelMap selectedRow)
This will add the 'lookup' attribute on the request stream, with a Map containing the fieldnames (from the targetFields property) and values (from the input selectedRow). It will then invoke the quit() method on itself. Finally it will return a FormKey object for the generic lookup jsp.

Parameters:
request - The HTTP request we are processing
selectedRow - The row that gets selected on the Results screen.
Returns:
a FormKey object for the generic lookup jsp.

performLookup

public FormKey performLookup(HttpServletRequest request,
                             Map selectedRow)
This will add the 'lookup' attribute on the request stream, with a Map containing the fieldnames (from the targetFields property) and values (from the input selectedRow). It will then invoke the quit() method on itself. Finally it will return a FormKey object for the generic lookup jsp.

Parameters:
request - The HTTP request we are processing
selectedRow - The row that gets selected on the Results screen.
Returns:
a FormKey object for the generic lookup jsp.

getMultiSelectLookupListeners

protected Collection getMultiSelectLookupListeners()
Returns a Collection of IMultiSelectLookupListener objects.

Returns:
a Collection of IMultiSelectLookupListener objects.

invokeMultiSelectLookupListeners

protected void invokeMultiSelectLookupListeners(MultiSelectLookupEvent event)
Invokes the rowsSelected() method of the registered IMultiSelectLookupListener objects in the same thread.

Parameters:
event - The event object containing the row(s) selected.


Copyright © 2002-2004 JAFFA Project.