Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

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 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

       ELSE

               nPointer = nPointer + 1

       END IF

LOOP

MSGBOX(objRecSet.GetColVal(1))



        
DevX Pro
 
Comment and Contribute

 

 

 

 

 


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

 

 

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