Solved

Drop Down displays the Data Value instead of Display Value

Posted on 2003-11-30
7
931 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

623 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