com.nqadmin.swingSet
Class SSDBComboBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JComboBox
                  extended by com.nqadmin.swingSet.SSDBComboBox
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListDataListener

public class SSDBComboBox
extends javax.swing.JComboBox

SSDBComboBox.java

SwingSet - Open Toolkit For Making Swing Controls Database-Aware

 Similar to the SSComboBox, but used when both the 'bound' values and the
 'display' values are pulled from a database table.  Generally the bound
 value represents a foreign key to another table, and the combobox needs to
 display a list of one (or more) columns from the other table.

 Note, if changing both a sSRowSet and column name consider using the bind()
 method rather than individual setSSRowSet() and setColumName() calls.

 e.g.

      Consider two tables:
        1. part_data (part_id, part_name, ...)
        2. shipment_data (shipment_id, part_id, quantity, ...)

      Assume you would like to develop a screen for the shipment table and you
      want to have a screen with a combobox where the user can choose a
      part and a textbox where the user can specify a  quantity.

      In the combobox you would want to display the part name rather than
      part_id so that it is easier for the user to choose. At the same time you
      want to store the id of the part chosen by the user in the shipment
      table.

      SSConnection connection = null;
      SSJdbcRowSetImpl sSRowSet = null;
      SSDataNavigator navigator = null;
      SSDBComboBox combo = null;

      try {

      // CREATE A DATABASE CONNECTION OBJECT
           SSConnection connection = new SSConnection(........);

      // CREATE AN INSTANCE OF SSJDBCROWSETIMPL
           SSJdbcRowsetImpl sSRowSet = new SSJdbcRowsetImpl(connection);
           sSRowSet.setCommand("SELECT * FROM shipment_data;");

      // DATA NAVIGATOR CALLS THE EXECUTE AND NEXT FUNCTIONS ON THE SSROWSET.
      // IF YOU ARE NOT USING THE DATA NAVIGATOR YOU HAVE TO INCLUDE THOSE.
      //   sSRowSet.execute();
      //   sSRowSet.next();
           SSDataNavigator navigator = new SSDataNavigator(sSRowSet);

      // QUERY FOR THE COMBOBOX.
           String query = "SELECT * FROM part_data;";

      // CREATE AN INSTANCE OF THE SSDBCOMBOBOX WITH THE CONNECTION OBJECT
      // QUERY AND COLUMN NAMES
           combo = new SSDBComboBox(connection,query,"part_id","part_name");

      // THIS BASICALLY SPECIFIES THE COLUMN AND THE SSROWSET WHERE UPDATES HAVE
      // TO BE MADE.
           combo.bind(sSRowSet,"part_id");
           combo.execute();

      // CREATE A TEXTFIELD
           JTextField myText = new JTextField();
           myText.setDocument(new SSTextDocument(sSRowSet, "quantity");

      } catch(Exception e) {
      // EXCEPTION HANDLER HERE...
      }


      // ADD THE SSDBCOMBOBOX TO THE JFRAME
           getContentPane().add(combo.getComboBox());

      // ADD THE JTEXTFIELD TO THE JFRAME
           getContentPane().add(myText);

Version:
$Revision: 1.38 $
Author:
$Author: beevo $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.String columnName
          SSRowSet column to which the component will be bound.
protected  java.lang.String dateFormat
          Format for any date columns displayed in combo box.
protected  java.lang.String displayColumnName
          The database column used to populate the first visible column of the combo box.
 java.util.Map<java.lang.String,java.lang.Long> itemMap
           
protected  int numberOfItems
          Number of items in the combo box.
protected  java.lang.String primaryKeyColumnName
          The column name whose value is written back to the database when the user chooses an item in the combo box.
protected  java.lang.String query
          Query used to populate combo box.
protected  java.lang.String secondDisplayColumnName
          The database column used to populate the second (optional) visible column of the combo box.
protected  java.lang.String seperator
          Alphanumeric separator used to separate values in multi-column combo boxes.
protected  SSConnection sSConnection
          Database connection used to execute queries for combo population.
protected  SSRowSet sSRowSet
          SSRowSet from which component will get/set values.
 javax.swing.JTextField textField
          Text field bound to the SSRowSet.
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SSDBComboBox()
          Creates an object of the SSDBComboBox.
SSDBComboBox(SSConnection _sSConnection, java.lang.String _query, java.lang.String _primaryKeyColumnName, java.lang.String _displayColumnName)
          Constructs a SSDBComboBox with the given parameters.
 
Method Summary
 void addItem(java.lang.String _name, long _value)
          Adds an item to the existing list of items in the combo box.
 void addStringItem(java.lang.String _name, java.lang.String _value)
          Adds an item to the existing list of items in the combo box.
protected  void bind()
          Method for handling binding of component to a SSRowSet column.
 void bind(SSRowSet _sSRowSet, java.lang.String _columnName)
          Sets the SSRowSet and column name to which the component is to be bound.
 boolean deleteItem(long _value)
          Deletes the item which has value equal to _value.
 boolean deleteStringItem(java.lang.String _value)
          Deletes the item which has value equal to _value.
 void execute()
          Executes the query and adds items to the combo box based on the values retrieved from the database.
 java.lang.String getColumnName()
          Returns the column name to which the combo is bound.
 java.lang.String getDateFormat()
          Returns the pattern in which dates have to be displayed
 java.lang.String getDisplayColumnName()
          Returns the column name whose values are displayed in the combo box.
 int getInitialNumberOfItems()
           
 int getNumberOfItems()
          Returns the number of items present in the combo box.
 java.lang.String getQuery()
          Returns the query used to retrieve values from database for the combo box.
 java.lang.String getSecondDisplayColumnName()
          Returns the second column name whose values are also displayed in the combo box.
 long getSelectedFilteredValue()
           
 java.lang.String getSelectedStringValue()
          Returns the value of the selected item.
 long getSelectedValue()
          Returns the value of the selected item.
 java.lang.String getSeperator()
          Returns the seperator used when multiple columns are displayed
 SSConnection getSSConnection()
          Returns connection object used to get values from database.
 SSRowSet getSSRowSet()
          Returns the SSRowSet being used to get the values.
protected  java.lang.String getStringValue(java.sql.ResultSet _rs, java.lang.String _columnName)
          Method to return string equalivent of a given resultset column.
protected  void init()
          Initialization code.
 void setColumnName(java.lang.String _columnName)
          Sets the column name for the combo box
 void setDateFormat(java.lang.String _dateFormat)
          When a display column is of type date you can choose the format in which it has to be displayed.
 void setDisplayColumnName(java.lang.String _displayColumnName)
          Sets the column name whose values have to be displayed in combo box.
 void setFilterable(boolean filter)
          Method that sets the combo box to be filterable.
 void setPrimaryKeyColumnName(java.lang.String _primaryKeyColumnName)
           
 void setQuery(java.lang.String _query)
          Sets the query used to display items in the combo box.
 void setSecondDisplayColumnName(java.lang.String _secondDisplayColumnName)
          Sets the second display name.
 void setSelectedStringValue(java.lang.String _value)
          Sets the currently selected value Currently not a bean property since there is no associated variable.
 void setSelectedValue(long _value)
          Sets the currently selected value Currently not a bean property since there is no associated variable.
 void setSeperator(java.lang.String _seperator)
          Set the seperator to be used when multiple columns are displayed
 void setSSConnection(SSConnection _sSConnection)
          Sets the connection object to be used.
 void setSSRowSet(SSRowSet _sSRowSet)
          Sets the new SSRowSet for the combo box.
protected  void updateDisplay()
          Updates the value displayed in the component based on the SSRowSet column binding.
 boolean updateItem(long _value, java.lang.String _name)
          Updates the string thats being displayed.
 boolean updateStringItem(java.lang.String _value, java.lang.String _name)
          Updates the string thats being displayed.
 
Methods inherited from class javax.swing.JComboBox
actionPerformed, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

textField

public javax.swing.JTextField textField
Text field bound to the SSRowSet. Bee changed to public


sSConnection

protected SSConnection sSConnection
Database connection used to execute queries for combo population.


query

protected java.lang.String query
Query used to populate combo box.


primaryKeyColumnName

protected java.lang.String primaryKeyColumnName
The column name whose value is written back to the database when the user chooses an item in the combo box. This is generally the PK of the table to which a foreign key is mapped.


displayColumnName

protected java.lang.String displayColumnName
The database column used to populate the first visible column of the combo box.


secondDisplayColumnName

protected java.lang.String secondDisplayColumnName
The database column used to populate the second (optional) visible column of the combo box.


numberOfItems

protected int numberOfItems
Number of items in the combo box.


sSRowSet

protected SSRowSet sSRowSet
SSRowSet from which component will get/set values.


columnName

protected java.lang.String columnName
SSRowSet column to which the component will be bound.


seperator

protected java.lang.String seperator
Alphanumeric separator used to separate values in multi-column combo boxes.


dateFormat

protected java.lang.String dateFormat
Format for any date columns displayed in combo box.


itemMap

public java.util.Map<java.lang.String,java.lang.Long> itemMap
Constructor Detail

SSDBComboBox

public SSDBComboBox()
Creates an object of the SSDBComboBox.


SSDBComboBox

public SSDBComboBox(SSConnection _sSConnection,
                    java.lang.String _query,
                    java.lang.String _primaryKeyColumnName,
                    java.lang.String _displayColumnName)
Constructs a SSDBComboBox with the given parameters.

Parameters:
_sSConnection - database connection to be used.
_query - query to be used to retrieve the values from the database.
_primaryKeyColumnName - column name whose value has to be stored.
_displayColumnName - column name whose values are displayed in the combo box.
Method Detail

setSSRowSet

public void setSSRowSet(SSRowSet _sSRowSet)
Sets the new SSRowSet for the combo box.

Parameters:
_sSRowSet - SSRowSet to which the combo has to update values.

getSSRowSet

public SSRowSet getSSRowSet()
Returns the SSRowSet being used to get the values.

Returns:
returns the SSRowSet being used.

setSSConnection

public void setSSConnection(SSConnection _sSConnection)
Sets the connection object to be used.

Parameters:
_sSConnection - connection object used for database.

getSSConnection

public SSConnection getSSConnection()
Returns connection object used to get values from database.

Returns:
returns a SSConnection object.

setQuery

public void setQuery(java.lang.String _query)
Sets the query used to display items in the combo box.

Parameters:
_query - query to be used to get values from database (to display combo box items)

getQuery

public java.lang.String getQuery()
Returns the query used to retrieve values from database for the combo box.

Returns:
returns the query used.

setColumnName

public void setColumnName(java.lang.String _columnName)
Sets the column name for the combo box

Parameters:
_columnName - name of column

getColumnName

public java.lang.String getColumnName()
Returns the column name to which the combo is bound.

Returns:
returns the column name to which to combo box is bound.

setDisplayColumnName

public void setDisplayColumnName(java.lang.String _displayColumnName)
Sets the column name whose values have to be displayed in combo box.

Parameters:
_displayColumnName - column name whose values have to be displayed.

getDisplayColumnName

public java.lang.String getDisplayColumnName()
Returns the column name whose values are displayed in the combo box.

Returns:
returns the name of the column used to get values for combo box items.

setPrimaryKeyColumnName

public void setPrimaryKeyColumnName(java.lang.String _primaryKeyColumnName)

setDateFormat

public void setDateFormat(java.lang.String _dateFormat)
When a display column is of type date you can choose the format in which it has to be displayed. For the pattern refer SimpleDateFormat in java.text package.

Parameters:
_dateFormat - pattern in which dates have to be displayed

getDateFormat

public java.lang.String getDateFormat()
Returns the pattern in which dates have to be displayed

Returns:
returns the pattern in which dates have to be displayed

setSecondDisplayColumnName

public void setSecondDisplayColumnName(java.lang.String _secondDisplayColumnName)
Sets the second display name. If more than one column have to displayed then use this. For the parts example given above. If you have a part description in part table. Then you can display both part name and part description.

Parameters:
_secondDisplayColumnName - column name whose values have to be displayed in the combo in addition to the first column name.

getSecondDisplayColumnName

public java.lang.String getSecondDisplayColumnName()
Returns the second column name whose values are also displayed in the combo box.

Returns:
returns the name of the column used to get values for combo box items. returns NULL if the second display column is not provided.

setSeperator

public void setSeperator(java.lang.String _seperator)
Set the seperator to be used when multiple columns are displayed

Parameters:
_seperator - seperator to be used.

getSeperator

public java.lang.String getSeperator()
Returns the seperator used when multiple columns are displayed

Returns:
seperator used.

getNumberOfItems

public int getNumberOfItems()
Returns the number of items present in the combo box. This is a read-only bean property.

Returns:
returns the number of items present in the combo box.

getInitialNumberOfItems

public int getInitialNumberOfItems()

setSelectedValue

public void setSelectedValue(long _value)
Sets the currently selected value Currently not a bean property since there is no associated variable.

Parameters:
_value - value to set as currently selected.

getSelectedValue

public long getSelectedValue()
Returns the value of the selected item. Currently not a bean property since there is no associated variable.

Returns:
value corresponding to the selected item in the combo. return -1 if no item is selected.

setSelectedStringValue

public void setSelectedStringValue(java.lang.String _value)
Sets the currently selected value Currently not a bean property since there is no associated variable.

Parameters:
_value - value to set as currently selected.

getSelectedStringValue

public java.lang.String getSelectedStringValue()
Returns the value of the selected item. Currently not a bean property since there is no associated variable.

Returns:
value corresponding to the selected item in the combo. return null if no item is selected.

execute

public void execute()
             throws java.sql.SQLException,
                    java.lang.Exception
Executes the query and adds items to the combo box based on the values retrieved from the database.

Throws:
java.sql.SQLException
java.lang.Exception

bind

public void bind(SSRowSet _sSRowSet,
                 java.lang.String _columnName)
Sets the SSRowSet and column name to which the component is to be bound.

Parameters:
_sSRowSet - datasource to be used.
_columnName - Name of the column to which this check box should be bound

addItem

public void addItem(java.lang.String _name,
                    long _value)
Adds an item to the existing list of items in the combo box.

Parameters:
_name - name that should be displayed in the combo
_value - value corresponding the the name

addStringItem

public void addStringItem(java.lang.String _name,
                          java.lang.String _value)
Adds an item to the existing list of items in the combo box.

Parameters:
_name - name that should be displayed in the combo
_value - value corresponding the the name

deleteItem

public boolean deleteItem(long _value)
Deletes the item which has value equal to _value. If more than one item is present in the combo for that value the first one is changed.

Parameters:
_value - value of the item to be deleted.
Returns:
returns true on successful deletion else returns false.

deleteStringItem

public boolean deleteStringItem(java.lang.String _value)
Deletes the item which has value equal to _value. If more than one item is present in the combo for that value the first one is changed.

Parameters:
_value - value of the item to be deleted.
Returns:
returns true on successful deletion else returns false.

updateItem

public boolean updateItem(long _value,
                          java.lang.String _name)
Updates the string thats being displayed. If more than one item is present in the combo for that value the first one is changed. NOTE: To retain changes made to current SSRowSet call updateRow before calling the updateItem on SSDBComboBox. (Only if you are using the SSDBComboBox and SSDataNavigator for navigation in the screen. If you are not using the SSDBComboBox for navigation then no need to call updateRow on the SSRowSet. Also if you are using only SSDBComboBox for navigation you need not call the updateRow.)

Parameters:
_value - the value corresponding to the item in combo to be updated.
_name - the new name that replace old one.
Returns:
returns true if successful else false.

updateStringItem

public boolean updateStringItem(java.lang.String _value,
                                java.lang.String _name)
Updates the string thats being displayed. If more than one item is present in the combo for that value the first one is changed. NOTE: To retain changes made to current SSRowSet call updateRow before calling the updateItem on SSDBComboBox. (Only if you are using the SSDBComboBox and SSDataNavigator for navigation in the screen. If you are not using the SSDBComboBox for navigation then no need to call updateRow on the SSRowSet. Also if you are using only SSDBComboBox for navigation you need not call the updateRow.)

Parameters:
_value - the value corresponding to the item in combo to be updated.
_name - the new name that replace old one.
Returns:
returns true if successful else false.

init

protected void init()
Initialization code.


bind

protected void bind()
Method for handling binding of component to a SSRowSet column.


updateDisplay

protected void updateDisplay()
Updates the value displayed in the component based on the SSRowSet column binding.


getStringValue

protected java.lang.String getStringValue(java.sql.ResultSet _rs,
                                          java.lang.String _columnName)
Method to return string equalivent of a given resultset column.

Parameters:
_rs - ResultSet containing column to analyize
_columnName - column to convert to string
Returns:
string equilivent of specified resultset column

getSelectedFilteredValue

public long getSelectedFilteredValue()

setFilterable

public void setFilterable(boolean filter)
Method that sets the combo box to be filterable.

Parameters:
filter - boolean to turn filtering on or off