Solved

Drop Down displays the Data Value instead of Display Value

Posted on 2003-11-30
7
916 Views
Last Modified: 2013-12-26
BackGround:
Consider a Grid DataWindow with FIELDS, A & B.
Both the fields are with edit style Drop Down Datawindow.
The Data Value is different from the Display value for FIELD B DDDW.
The FIELD B DDDW, retrieves based on the value entred in the FIELD A.

Issue Description:

Suppose the FIELD A DDDW has two values:  a, b

Corresponding Data (Display) values in the FIELD B DDDW are:
For a:
1 (ONE)
2 (TWO)

For b:
3 (THREE)
4 (FOUR)

The first row in the grid is saved with the value 'a' for the FIELD A and '1' for the FIELD B. The Field B displays the display value i.e ONE.
Now another row is saved with the value 'b' forthe field 'A' and '3' for the field 'B'. The field B in the first row now displays '1' instead of 'ONE'


0
Comment
Question by:girishdhruva
7 Comments
 
LVL 5

Expert Comment

by:gafoor78
ID: 9845914
Hi

It is bcos the retrieve is applying for all the DDDw in the DW....but u can stimulate it

just look at this previous solution

http://www.experts-exchange.com/Programming/Programming_Languages/PowerBuilder/Q_20652332.html

rgrds
gafoor

0
 
LVL 5

Expert Comment

by:gafoor78
ID: 9845938
read the above line
It is bcos the retrieve is applying for all the DDDw in the DW

as
it is bcos the retrieve applying for all the rows for that DDDW. so in the second retrieve the first row will also change..that time there is no ONE is avilable..so it is showing the data value instead
0
 
LVL 6

Expert Comment

by:DaniPro
ID: 9848860
If you change the retrieval argument in a dddw or apply a different filter condition this produce his effect on all the row ....
You can try to don't apply the filter but hide the undesirable row with the SetDetailHeight function [ ex. child_dddw.SetDetailHeight(iniRow, endRow, 0) ]
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 8

Expert Comment

by:gajender_99
ID: 9849094
if you want an example how this should work send send me an e-mail on gajender_99 at hotmail.com
0
 
LVL 2

Expert Comment

by:mdhampton
ID: 9896119
To expand on the above answers:

In the datawindow for the FIELD B dropdown, retrieve ALL values. Include FIELD A in the retrieve (but optional for display). In the rowfocuschanged event, get the datawindow child for FIELD B, and step through each row of the datawindow child, and set the detail height to 0 for all rows that do not match.

The biggest problem with this is that if the user uses the keyboard, they can sometime select values that have the detail height = 0. (I have seen this with the down and up arrows). You wil want to perform extra validation in the itemchanged event to prevent the user from entering invalid data.

If anyone knows how to prevent the above problem, let me know!
0
 
LVL 1

Accepted Solution

by:
bendep earned 500 total points
ID: 12816975
you could use an overlapping computed field containing the lookup-value (see PB help lookupdisplay) for an (always) invisible fieldb_1 (having a dddw with all possible values for B so lookup will always work). This computed field should be set visible for all rows except the current row (visible expression: 'if(currentrow=getrow(), 0, 1)'),
while another fieldb_2 will be visible only on the current row (visible expression: 'if(currentrow=getrow(), 1, 0)') that holds a filtered dddw which show only the appropriate values for field A.

So -in short- you need 3 controls:

- fieldb_1 always invisible but contains a dddw with all possible display values for B
- fieldb_2 only visible for current row, contains a dddw with only appropriate values for A (code refresh in rowfocuschanged event)
- computed_fieldB: visible for all rows except the only that is current (focused), contains an expression that looks up the displayvalue from fieldb_1. Expression: lookupdisplay(fieldb_1)

I know this sounds a bit confusing but this solution does work for me.

Ben
0
 

Author Comment

by:girishdhruva
ID: 12864860
Thanks Ben

This solution works fine. Infact I was using the same work around for our application also.

Thanks again,
Girish
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question