Solved

Drop Down displays the Data Value instead of Display Value

Posted on 2003-11-30
7
910 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 8

Expert Comment

by:gajender_99
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Ben

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

Thanks again,
Girish
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now