devxlogo

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

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 

devx-admin

Share the Post: