|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.FormSection
com.arsdigita.bebop.FormStep
com.arsdigita.bebop.form.MultipleSelectPairWidget
Multiple select widget pair for knowledge types. This FormStep displays two multiple select widgets, one which contains possible the user may want to add, and the right displays the options that are currently applicable.
To use the widget, you should call setLeftMultipleSelect(RequestLocal)
and setRightMultipleSelect(RequestLocal)
and pass in the appropriate
collections to initialize the MutlipleSelect options. Then, in the
process listener of the form in which the MultipleSelectPairWidget
is embedded, call getSelectedOptions(PageState)
and getUnselectedOptions(PageState)
to get the chosen values. The process
listener for the parent form must use the Submit.isSelected(ps) so
that the process listener can distinguish between different types
of form submits.
Note that the right multiple select can be empty and does not need
to be set. This class also uses a relatively inefficient
implementation of removeOption in OptionGroup
so that operations run in O(N^2). This can be reduced to O(N) with
a more optimal implementation of OptionGroup.
Option
,
OptionGroup
Field Summary | |
static String |
versionId
|
Fields inherited from class com.arsdigita.bebop.FormSection |
m_formModel, m_panel |
Fields inherited from class com.arsdigita.bebop.SimpleComponent |
m_attr |
Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Constructor Summary | |
MultipleSelectPairWidget()
This create a standard MultipleSelectPairWidget with the default names used for internal widgets. |
|
MultipleSelectPairWidget(String nameQualifier)
|
Method Summary | |
void |
generateXML(PageState state,
Element element)
Builds an XML subtree for this component under the specified parent . |
Widget |
getLeftSelect()
This returns the left select widget so that callers can have access to the underlying parameters and other features (e.g. |
Widget |
getRightSelect()
This returns the left select widget so that callers can have access to the underlying parameters and other features (e.g. |
String[] |
getSelectedOptions(PageState ps)
Returns the selected options, those selected from the left hand widget |
String[] |
getUnselectedOptions(PageState ps)
Returns the unselected options, those removed from the right hand widget |
boolean |
isSelected(PageState ps)
|
boolean |
leftSideChanges()
This returns an indication of whether or not the left multiple select changes as items are moved from the left to the right. |
void |
setLeftMultipleSelect(RequestLocal collection)
|
void |
setLeftMultipleSelectMap(RequestLocal map)
This lets the user pass in a RequestLocal that returns a java.util.Map that contains the option value as the key and the actual option as the map value. |
void |
setLeftSideChanges(boolean doesChange)
|
void |
setMultipleSelectSize(int size)
|
void |
setRightMultipleSelect(RequestLocal collection)
|
void |
setRightMultipleSelectMap(RequestLocal map)
This lets the user pass in a RequestLocal that returns a java.util.Map that contains the option value as the key and the actual option as the map value. |
Methods inherited from class com.arsdigita.bebop.FormStep |
createInitListener, fireProcess, fireSubmitted, fireValidate, isInitialized, register, register |
Methods inherited from class com.arsdigita.bebop.FormSection |
add, add, addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, forwardInit, forwardProcess, forwardSubmission, forwardValidation, get, getModel, getPanel, indexOf, isEmpty, lock, process, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, respond, size |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
Methods inherited from class com.arsdigita.bebop.Completable |
addCompletionListener, fireCompletionEvent |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
Methods inherited from interface com.arsdigita.util.Lockable |
isLocked |
Field Detail |
public static final String versionId
Constructor Detail |
public MultipleSelectPairWidget()
public MultipleSelectPairWidget(String nameQualifier)
Method Detail |
public boolean isSelected(PageState ps)
public void setLeftMultipleSelect(RequestLocal collection)
collection
- A collection of Option objectspublic void setLeftMultipleSelectMap(RequestLocal map)
public void setRightMultipleSelectMap(RequestLocal map)
public Widget getLeftSelect()
public Widget getRightSelect()
public void setLeftSideChanges(boolean doesChange)
doesChange
- This indicates whether the items in the
"to add" select box are removed as they are added to
the "to remove" select box. That is, as choices are
selected, should they be removed from the list of
choices? This defaults to true.public boolean leftSideChanges()
public void setRightMultipleSelect(RequestLocal collection)
collection
- A collection of Option objectspublic String[] getSelectedOptions(PageState ps)
public String[] getUnselectedOptions(PageState ps)
public void generateXML(PageState state, Element element)
FormSection
parent
. Uses the request values stored in
state
.
This method generates DOM to be used with the XSLT template to produce the appropriate output.
generateXML
in interface Component
generateXML
in class FormStep
public void setMultipleSelectSize(int size)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |