Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02


oracle.jbo.uicli.binding
Class JUCtrlListBinding

java.lang.Object
  extended byjava.util.AbstractMap
      extended byoracle.jbo.common.JboAbstractMap
          extended byoracle.adf.model.binding.DCControlBinding
              extended byoracle.jbo.uicli.binding.JUControlBinding
                  extended byoracle.jbo.uicli.binding.JUCtrlValueBinding
                      extended byoracle.jbo.uicli.binding.JUCtrlAttrsBinding
                          extended byoracle.jbo.uicli.binding.JUCtrlListBinding

All Implemented Interfaces:
java.util.EventListener, JUCtrlInputValueHandler, java.util.Map, RowNavigationListener, RowSetListener, RowSetManagementListener, StructureDef
Direct Known Subclasses:
JUButtonGroupBinding, JUComboBoxBinding, JUCtrlBoolBinding, JUListSingleSelBinding, JULovButtonBinding, JUSpinnerBinding

public class JUCtrlListBinding
extends JUCtrlAttrsBinding
implements RowSetListener, RowSetManagementListener

A JUCtrlAttrsBinding class responsible displaying a list of values from a static list or a list calculated at runtime using another BC4J ViewObject/RowIterator. This binding operates in two ways:

The operating mode is to be setup in the constructor of this binding.

This binding works in two updateable modes:

This binding can also be used to iterator through a RowIterator object and display single or multiple attributes from the rows.


Nested Class Summary

Nested classes inherited from class java.util.Map
java.util.Map.Entry

Field Summary
static java.lang.String DH_CONTROL_TYPE
static java.lang.String DH_DISPLAY_HEIGHT
static java.lang.String DH_DISPLAY_HINT
static java.lang.String DH_DISPLAY_WIDTH
static java.lang.String DH_FORMAT
static java.lang.String DH_LABEL
Constants to access elements in the map returned in getDisplayHints()
static java.lang.String DH_TOOLTIP
static int LIST_OPER_NAVIGATE
Indicates that list binding will be used to navigate Rows in a RowIterator.
static int LIST_OPER_SET_ATTRIBUTE
Indicates this list binding will be used to update attributes in a target ViewObject.
static java.lang.String LISTITEM_DisplayValues
static java.lang.String LISTITEM_Index
static java.lang.String LISTITEM_Prompt
static java.lang.String LISTITEM_Selected
Constants to access elements in the map returned in getDisplayData()
static java.lang.String LISTITEM_SelectedIndex
protected AttributeDef mFirstDisplayAttr
protected java.lang.String[] mListAttrNames
Ordered list of attribute names that this control binding should use to update the target ViewObject's attributes.
protected java.lang.String[] mListDisplayAttrNames
Ordered list of attributes that this control binding should use to display the Rows from the LOV ViewObject.
protected DCIteratorBinding mListIterBinding
Iterator Binding object that this binding uses to get the LOV data.
protected boolean mSingleAttrList
protected boolean mStaticList
Controls whether the list of values should be fetched once or should this list update itself when the ViewObject for the LOV changes.
protected java.lang.Object[] mValueList
List of values displayed in the bound control.

Fields inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
ATTR_ATTRIBUTE, ATTR_ATTRIBUTE_DEF, ATTR_ATTRIBUTE_DEFS, ATTR_ATTRIBUTE_VALUE, ATTR_ATTRIBUTE_VALUES, ATTR_ATTRIBUTES, ATTR_DISPLAY_HINT, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_TOOLTIP, ATTR_UPDATEABLE, mHasInputVal, mInputVal, SEP_LIST_DISPLAY

Fields inherited from class oracle.adf.model.binding.DCControlBinding
ATTR_CURRENTROW, ATTR_DEF, ATTR_ERROR, ATTR_ERRORS, ATTR_FULLNAME, ATTR_ITER, ATTR_NAME, mInternalGet_KeyResolved, ROW_KEY_STR

Constructor Summary
protected JUCtrlListBinding()
*** For internal framework use only ***
protected JUCtrlListBinding(java.lang.Object control, DCIteratorBinding iterBinding, java.lang.String[] attrNames, DCIteratorBinding listIterBinding, java.lang.String[] listAttrNames, java.lang.String[] listDisplayAttrNames)
Uses the listIterBinding object to get the iterator and attribute names from listDisplayAttrNames to display attributes from the BC4J Rows in the iterator.
JUCtrlListBinding(java.lang.Object control, DCIteratorBinding iterBinding, java.lang.String[] attrNames, int listOperMode)
**For Testing purposes only*** Uses the same Iterator Binding to update as well as display values.
JUCtrlListBinding(java.lang.Object control, DCIteratorBinding iterBinding, java.lang.String[] attrNames, java.lang.Object[] valueList)
Uses the given static list of value objects to display data in the control.

Method Summary
void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
*** For internal framework use only ***
void convertValueList()
*** For internal framework use only ***
int findListIndex(java.lang.Object val)
java.lang.Object findMatchingListValue(java.lang.Object val)
java.lang.Object findValue(java.lang.Object val)
protected AttributeDef[] getDisplayAttributeDefs()
java.util.List getDisplayData()
Returns a List of Map elements.
java.util.List getDisplayHints()
Returns a List of Map elements (name-value pairs) for UI hints for all display attributes in this list binding.
java.util.Iterator getDisplayListIterator()
Returns an ArrayList of values that should be displayed in this list.
java.lang.Object getInputValue()
Primarily for spel support.
protected java.lang.String[] getListDisplayAttrNames()
DCIteratorBinding getListIterBinding()
Returns the iterator binding that is used to fill in the values for this list.
int getListOperMode()
Returns whether this list binding is used for Row Navigation or updating attributes on a target ViewObject (default).
int getSelectedIndex()
protected int getSelectedIndexValue()
java.lang.Object getSelectedValue()
java.lang.Object getValueAt(int attrIndex)
Gets the value from the control for the attribute at the given index.
java.lang.Object getValueFromList(int listIndex)
java.lang.Object[] getValueList()
*** For internal framework use only ***
protected java.lang.Object internalGet(java.lang.String key)
Subclasses should override this to handle a specific key.
protected boolean isControlQueriable()
For ADF/nonJClient apps return true so that list bindings are created as queriable if the bound iteratorBinding allows findmode.
boolean isSingleAttrList()
*** For internal framework use only ***
protected boolean isViewInitialized()
void iteratorClosed(RowSetManagementEvent event)
Resets the internal state of this binding object and marks it as unusable.
void iteratorReset(RowSetManagementEvent event)
Notifies rangeRefreshed to all bindings so that they can update their display.
protected boolean matchTargetWithLov(Row targetRow, Row lovRow)
*** For internal framework use only ***
void navigated(NavigationEvent event)
*** For internal framework use only ***
boolean processNewInputValue(java.lang.Object value)
Compares the value (assumed to be a numeric String or an Integer) with currently selected index in this listbinding and if different, then returns true.
java.lang.Object put(java.lang.Object obj, java.lang.Object value)
void rangeRefreshed(RangeRefreshEvent event)
*** For internal framework use only ***
void rangeScrolled(ScrollEvent event)
*** For internal framework use only ***
protected void release(int flags)
void rowDeleted(DeleteEvent event)
*** For internal framework use only ***
void rowInserted(InsertEvent event)
*** For internal framework use only ***
void rowUpdated(UpdateEvent event)
*** For internal framework use only ***
void setAttributeFromValueList(int listIndex)
void setDataValueAt(java.lang.Object value, int attrIndex)
void setInputValue(java.lang.Object value)
Primarily for spel support.
void setListOperMode(int listOperMode)
*** For internal framework use only ***
protected int setListValueAsSelected(java.lang.Object val)
void setSelectedIndex(int indx)
protected void setSelectedIndexValue(int indx)
protected void setSingleAttrList(boolean flag)
*** For internal framework use only ***
protected void setStaticList(boolean staticList)
protected void setTargetAttrsFromLovRow(Row targetRow, Row lovRow)
*** For internal framework use only ***
protected void setupListItems(boolean clean, boolean keepSelectedIndex)
If this list is displaying a single attribute and updates a single attribute, then this method fetches the attribute value from all the rows in the given LOV list iterator and sets that as the list of values to display in the bound control.
void setValueAt(java.lang.Object value, int attrIndex)
Updates the control/control-binding with the latest value of the attribute at the given index with the given value.
void setValueList(java.lang.Object[] valueList)
*** For internal framework use only ***
java.lang.String toString()
protected void updateTargetFromSelectedValue(java.lang.Object val)
void updateValuesFromRow(Row row)
Updates the control-binding and hence the control with attribute values from the attributes of this Row.

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
createAttributeBinding, refreshControl, setControlEnabled, updateNavigated, updateRangeScrolled, updateValuesFromRows

Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
compareAndSetAttribute, displayInShortForm, findAttributeDef, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDef, getAttributeDefs, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributeNames, getAttributes, getAttributes, getAttributeUIHelper, getAttributeValidators, getAttributeValidators, getAttributeValue, getAttributeValue, getAttributeValueFromRow, getAttributeValues, getAttributeValues, getControlType, getDisplayHeight, getDisplayHint, getDisplayWidth, getError, getErrors, getHint, getHint, getLabel, getLabel, getLabels, getLabelSet, getLocaleContext, getMergedAttributeValues, getPath, getTooltip, getTooltip, hasFormatInformation, internalGetRow, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isMandatory, isNewInputValue, isUpdateable, lookupAttributeDef, processInputException, resetInputState, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeValue, setError, setInputValue, setInputValueHandler, stopEditing, updateRowDeleted, updateRowInserted

Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
getFormBinding, getIteratorBinding, reportException, setFormBinding

Methods inherited from class oracle.adf.model.binding.DCControlBinding
addToDCExceptions, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getBindingContainer, getControl, getControlModel, getCurrentRow, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getLayoutObject, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, hashCode, internalSetName, needsEstimatedRowCount, removeFromDCExceptions, reportException, resetAttributeExceptionInRow, setBindingContainer, setControl, setName

Methods inherited from class oracle.jbo.common.JboAbstractMap
entrySet, equals

Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, isEmpty, keySet, putAll, remove, size, values

Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface oracle.jbo.StructureDef
getDefFullName, getDefName, getFullName, getName

Field Detail

LIST_OPER_SET_ATTRIBUTE

public static int LIST_OPER_SET_ATTRIBUTE
Indicates this list binding will be used to update attributes in a target ViewObject. This is the default mode

LIST_OPER_NAVIGATE

public static int LIST_OPER_NAVIGATE
Indicates that list binding will be used to navigate Rows in a RowIterator.

mSingleAttrList

protected boolean mSingleAttrList

mValueList

protected java.lang.Object[] mValueList
List of values displayed in the bound control. This could be a list of single attribute values or a list of BC4J Rows.

mListAttrNames

protected java.lang.String[] mListAttrNames
Ordered list of attribute names that this control binding should use to update the target ViewObject's attributes.

mListDisplayAttrNames

protected java.lang.String[] mListDisplayAttrNames
Ordered list of attributes that this control binding should use to display the Rows from the LOV ViewObject.

mListIterBinding

protected DCIteratorBinding mListIterBinding
Iterator Binding object that this binding uses to get the LOV data.

mStaticList

protected boolean mStaticList
Controls whether the list of values should be fetched once or should this list update itself when the ViewObject for the LOV changes.

mFirstDisplayAttr

protected AttributeDef mFirstDisplayAttr

LISTITEM_Selected

public static final java.lang.String LISTITEM_Selected
Constants to access elements in the map returned in getDisplayData()
See Also:
Constant Field Values

LISTITEM_Index

public static final java.lang.String LISTITEM_Index
See Also:
Constant Field Values

LISTITEM_Prompt

public static final java.lang.String LISTITEM_Prompt
See Also:
Constant Field Values

LISTITEM_DisplayValues

public static final java.lang.String LISTITEM_DisplayValues
See Also:
Constant Field Values

LISTITEM_SelectedIndex

public static final java.lang.String LISTITEM_SelectedIndex
See Also:
Constant Field Values

DH_LABEL

public static final java.lang.String DH_LABEL
Constants to access elements in the map returned in getDisplayHints()
See Also:
Constant Field Values

DH_TOOLTIP

public static final java.lang.String DH_TOOLTIP
See Also:
Constant Field Values

DH_DISPLAY_HINT

public static final java.lang.String DH_DISPLAY_HINT
See Also:
Constant Field Values

DH_DISPLAY_HEIGHT

public static final java.lang.String DH_DISPLAY_HEIGHT
See Also:
Constant Field Values

DH_DISPLAY_WIDTH

public static final java.lang.String DH_DISPLAY_WIDTH
See Also:
Constant Field Values

DH_CONTROL_TYPE

public static final java.lang.String DH_CONTROL_TYPE
See Also:
Constant Field Values

DH_FORMAT

public static final java.lang.String DH_FORMAT
See Also:
Constant Field Values

Constructor Detail

JUCtrlListBinding

protected JUCtrlListBinding()
*** For internal framework use only ***

JUCtrlListBinding

public JUCtrlListBinding(java.lang.Object control,
                         DCIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         int listOperMode)
**For Testing purposes only*** Uses the same Iterator Binding to update as well as display values.

JUCtrlListBinding

public JUCtrlListBinding(java.lang.Object control,
                         DCIteratorBinding iterBinding,
                         java.lang.String[] attrNames,
                         java.lang.Object[] valueList)
Uses the given static list of value objects to display data in the control.

JUCtrlListBinding

protected JUCtrlListBinding(java.lang.Object control,
                            DCIteratorBinding iterBinding,
                            java.lang.String[] attrNames,
                            DCIteratorBinding listIterBinding,
                            java.lang.String[] listAttrNames,
                            java.lang.String[] listDisplayAttrNames)
Uses the listIterBinding object to get the iterator and attribute names from listDisplayAttrNames to display attributes from the BC4J Rows in the iterator. Also maps values from listAttrNames attributes to the set of attributes (attrNames) in the current row of the target iterator referred by iterBinding object

Method Detail

setupListItems

protected void setupListItems(boolean clean,
                              boolean keepSelectedIndex)
If this list is displaying a single attribute and updates a single attribute, then this method fetches the attribute value from all the rows in the given LOV list iterator and sets that as the list of values to display in the bound control.

If this list is displaying multiple attributes and/or is used in navigation mode, then the valueList is set with the list of all rows from the LOV Iterator binding. In this case, this binding also listens to events from the RowSetIterator for row currency changes, new rows, etc.


getListIterBinding

public DCIteratorBinding getListIterBinding()
Returns the iterator binding that is used to fill in the values for this list.

getListOperMode

public int getListOperMode()
Returns whether this list binding is used for Row Navigation or updating attributes on a target ViewObject (default). The possible values are:

getListDisplayAttrNames

protected java.lang.String[] getListDisplayAttrNames()

setListOperMode

public void setListOperMode(int listOperMode)
*** For internal framework use only ***

Sets the operating mode for this list binding.


setSingleAttrList

protected void setSingleAttrList(boolean flag)
*** For internal framework use only ***

isSingleAttrList

public boolean isSingleAttrList()
*** For internal framework use only ***

setValueList

public void setValueList(java.lang.Object[] valueList)
*** For internal framework use only ***

convertValueList

public void convertValueList()
*** For internal framework use only ***

getSelectedIndex

public int getSelectedIndex()

setSelectedIndex

public void setSelectedIndex(int indx)

setSelectedIndexValue

protected void setSelectedIndexValue(int indx)

getSelectedIndexValue

protected int getSelectedIndexValue()

getValueAt

public java.lang.Object getValueAt(int attrIndex)
Description copied from class: JUCtrlAttrsBinding
Gets the value from the control for the attribute at the given index. (The index is calculated from the list of attributes this control binding is bound to as passed in the constructor). Framework uses this method to get the attribute value from the control and pass it on to the Row object on the BC4J side.
Overrides:
getValueAt in class JUCtrlAttrsBinding

getValueList

public java.lang.Object[] getValueList()
*** For internal framework use only ***

Returns the static value list as set into this listbinding incase of enumeration lists. In case of Row bound lists, returns an array of LOV rows set into this listbinding.


getDisplayListIterator

public java.util.Iterator getDisplayListIterator()
Returns an ArrayList of values that should be displayed in this list. If this listbinding has multiple display attributes, then each element in the returned list is itself an arraylist of that many attribute values.

getSelectedValue

public java.lang.Object getSelectedValue()

matchTargetWithLov

protected boolean matchTargetWithLov(Row targetRow,
                                     Row lovRow)
*** For internal framework use only ***

setListValueAsSelected

protected int setListValueAsSelected(java.lang.Object val)

findMatchingListValue

public java.lang.Object findMatchingListValue(java.lang.Object val)

findListIndex

public int findListIndex(java.lang.Object val)

toString

public java.lang.String toString()
Overrides:
toString in class JUCtrlAttrsBinding

findValue

public java.lang.Object findValue(java.lang.Object val)

getValueFromList

public java.lang.Object getValueFromList(int listIndex)

isViewInitialized

protected boolean isViewInitialized()

isControlQueriable

protected boolean isControlQueriable()
For ADF/nonJClient apps return true so that list bindings are created as queriable if the bound iteratorBinding allows findmode.
Overrides:
isControlQueriable in class JUCtrlAttrsBinding

updateValuesFromRow

public void updateValuesFromRow(Row row)
Description copied from class: JUCtrlAttrsBinding
Updates the control-binding and hence the control with attribute values from the attributes of this Row. Invokes setValueAt() with the attribute value and attribute index with respect to attributes for which this binding is interested.

This method also enables/disables the Swing control based on the updateability of the first (Default) attribute to which this control is bound.

Overrides:
updateValuesFromRow in class JUCtrlAttrsBinding

setTargetAttrsFromLovRow

protected void setTargetAttrsFromLovRow(Row targetRow,
                                        Row lovRow)
*** For internal framework use only ***

setAttributeFromValueList

public void setAttributeFromValueList(int listIndex)

updateTargetFromSelectedValue

protected void updateTargetFromSelectedValue(java.lang.Object val)

rangeRefreshed

public void rangeRefreshed(RangeRefreshEvent event)
*** For internal framework use only ***
Specified by:
rangeRefreshed in interface RowSetListener
Parameters:
event - a description of the new ranges.

rowInserted

public void rowInserted(InsertEvent event)
*** For internal framework use only ***
Specified by:
rowInserted in interface RowSetListener
Parameters:
event - a description of the new Row object.

rowDeleted

public void rowDeleted(DeleteEvent event)
*** For internal framework use only ***
Specified by:
rowDeleted in interface RowSetListener
Parameters:
event - a description of the deleted Row object.

rowUpdated

public void rowUpdated(UpdateEvent event)
*** For internal framework use only ***
Specified by:
rowUpdated in interface RowSetListener
Parameters:
event - a description of the modified Row object.

navigated

public void navigated(NavigationEvent event)
*** For internal framework use only ***
Specified by:
navigated in interface RowSetListener
Parameters:
event - a description of the new and previous current rows.

rangeScrolled

public void rangeScrolled(ScrollEvent event)
*** For internal framework use only ***
Specified by:
rangeScrolled in interface RowSetListener
Parameters:
event - a description of the new range.

iteratorReset

public void iteratorReset(RowSetManagementEvent event)
Notifies rangeRefreshed to all bindings so that they can update their display.
Specified by:
iteratorReset in interface RowSetManagementListener
Parameters:
event - a description of the event.

iteratorClosed

public void iteratorClosed(RowSetManagementEvent event)
Resets the internal state of this binding object and marks it as unusable.
Specified by:
iteratorClosed in interface RowSetManagementListener
Parameters:
event - a description of the event.

release

protected void release(int flags)
Overrides:
release in class JUCtrlValueBinding

setDataValueAt

public void setDataValueAt(java.lang.Object value,
                           int attrIndex)
Overrides:
setDataValueAt in class JUCtrlAttrsBinding

setValueAt

public void setValueAt(java.lang.Object value,
                       int attrIndex)
Description copied from class: JUCtrlAttrsBinding
Updates the control/control-binding with the latest value of the attribute at the given index with the given value. This method is used by the framework to update the control with attribute values from a BC4J row.
Overrides:
setValueAt in class JUCtrlAttrsBinding

addControlToPanel

public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
Description copied from class: JUControlBinding
*** For internal framework use only ***
Overrides:
addControlToPanel in class JUCtrlAttrsBinding

put

public java.lang.Object put(java.lang.Object obj,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class JUCtrlValueBinding

getInputValue

public java.lang.Object getInputValue()
Primarily for spel support. Could be removed prior to 905Prod and merged into a get() method for spel-access.

Returns the last input value for the first attribute on this binding if this value raised an exception. Otherwise returns the value from the model object calling getAttribute(0);

Overrides:
getInputValue in class JUCtrlValueBinding

setInputValue

public void setInputValue(java.lang.Object value)
Primarily for spel support. Could be removed prior to 905Prod and merged into a get() method for spel-access.

Sets the value given and caches any error/exception in member variables for further access. Also rethrows the exception for outer methods to catch it.

Overrides:
setInputValue in class JUCtrlValueBinding

getDisplayData

public java.util.List getDisplayData()
Returns a List of Map elements. Each map entry contains the following four elements: