com.arsdigita.kernel.ui
Class PartySearchSelect

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.CompoundComponent
          extended bycom.arsdigita.kernel.ui.PartySearchSelect
All Implemented Interfaces:
Component, ExcursionComponent, Globalized, Globalized, Lockable

public class PartySearchSelect
extends CompoundComponent
implements ExcursionComponent, Globalized

Find a party in 2 steps: keyword search query followed by selecting from among the search results. Use PartySearchSelect.Search if you only want step 1 (the search functionality) and not step 2 (the select form).

Author:
Oumi Mehrota

Nested Class Summary
static class PartySearchSelect.Search
          A search form for searching a set of parties by name/email fragment.
 
Field Summary
 
Fields inherited from class com.arsdigita.bebop.Completable
versionId
 
Fields inherited from interface com.arsdigita.bebop.ExcursionComponent
versionId
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Fields inherited from interface com.arsdigita.kernel.ui.Globalized
BUNDLE_NAME, versionId
 
Fields inherited from interface com.arsdigita.globalization.Globalized
DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT
 
Constructor Summary
PartySearchSelect()
          Construct a search/select component for finding a party among all the parties in the system.
PartySearchSelect(RequestLocal basePartyCollection)
          Construct a search/select component for finding a party among those in the specified party collection.
 
Method Summary
 void addSearchFormSection(FormSection formSection)
          Adds a form section to the search form, used to provide additional UI for filtering/controlling the search results.
 PartyCollection getSearchQuery(PageState ps)
          Returns the collection of parties mathing the user's search criteria.
 Party getSelectedParty(PageState ps)
          Returns which party was selected by the user.
 void register(Page p)
          Registers state parameters for the page with its model.
 void setBaseQuery(PageState ps, PartyCollection parties)
          Specifies the set of parties from which the user will search and select.
 
Methods inherited from class com.arsdigita.bebop.CompoundComponent
add, add, children, contains, generateXML, get, getClassAttr, getContainer, getIdAttr, getKey, getStyleAttr, indexOf, isEmpty, isLocked, isVisible, lock, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible, size
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.ExcursionComponent
addCompletionListener
 
Methods inherited from interface com.arsdigita.bebop.Component
children, generateXML, getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Constructor Detail

PartySearchSelect

public PartySearchSelect()
Construct a search/select component for finding a party among all the parties in the system.


PartySearchSelect

public PartySearchSelect(RequestLocal basePartyCollection)
Construct a search/select component for finding a party among those in the specified party collection.

Method Detail

setBaseQuery

public void setBaseQuery(PageState ps,
                         PartyCollection parties)
Specifies the set of parties from which the user will search and select. Mainly useful in conjunction with addSearchFormSection(FormSection).


getSearchQuery

public PartyCollection getSearchQuery(PageState ps)
Returns the collection of parties mathing the user's search criteria. Mainly useful in conjunction with addSearchFormSection(FormSection).


addSearchFormSection

public void addSearchFormSection(FormSection formSection)
Adds a form section to the search form, used to provide additional UI for filtering/controlling the search results. The process listener of the form section can use getSearchQuery(PageState) in order to get the base search query and add filters to it. Alternatively, the process listener can use setSearchQuery(PageState, PartyCollection) to set the base query from scratch.


getSelectedParty

public Party getSelectedParty(PageState ps)
Returns which party was selected by the user. This will be null if the user cancels or does not complete the search-and-select process.


register

public void register(Page p)
Description copied from interface: Component
Registers state parameters for the page with its model. A simple component with a state parameter param would do the following in the body of this method:
   p.addComponent(this);
   p.addComponentStateParam(this, param);
 
You should override this method to set the default visibility of your component:
 public void register(Page p) {
     super.register(p);
     p.setVisibleDefault(childNotInitiallyShown,false);
     p.setVisibleDefault(anotherChild, false);
 }
 
Always call super.register when you override register. Otherwise your component may malfunction and produce errors like "Widget ... isn't associated with any Form"

Specified by:
register in interface Component
Overrides:
register in class CompoundComponent
See Also:
Component.register( Page )


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC