How can I get the display value of a list box?

Question:
How can I get the display value of a list box?

Answer:
In Oracle Power Objects, the Value property of the list box isautomatically set to the internal value of the selected entry in thelist box. A list box, or popup list or combo box, also displays avalue, which can be entirely different, depending on the Translationproperty ofthe object.

OPO maintains these two values internally with a two columnrecordset. The first column, with the name DispVal, holds thedisplay value, while the second column, DBVal, holds the actualvalue.

You can use recordset methods to walk through the recordset and findthe row whose second column matches the current Value poroperty ofthe list box. The first column of this row will contain thedisplayed value.

The code to bring up a message box with the display value for a listbox called lstSample is:

DIM objRecSet As ObjectobjRecSet = lstSample.GetRecordset()nPointer = 0DO WHILE nPointer < objRecSet.GetRowCount()       IF objRecSet.GetColVal(2) = lstSample.Value THEN               EXIT DO       ELSE               nPointer = nPointer + 1       END IFLOOPMSGBOX(objRecSet.GetColVal(1))        
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: