Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: SQL
Expertise: Beginner
Mar 21, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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

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

In Oracle Power Objects, the Value property of the list box is automatically set to the internal value of the selected entry in the list box. A list box, or popup list or combo box, also displays a value, which can be entirely different, depending on the Translation property ofthe object.

OPO maintains these two values internally with a two column recordset. The first column, with the name DispVal, holds the display value, while the second column, DBVal, holds the actual value.

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

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

DIM objRecSet As Object

objRecSet = lstSample.GetRecordset()

nPointer = 0

DO WHILE nPointer < objRecSet.GetRowCount()

       IF objRecSet.GetColVal(2) = lstSample.Value THEN

               EXIT DO


               nPointer = nPointer + 1

       END IF



DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date