Can I filter DDDW values out of itself?

Question:
I have a tabular DataWindow with a DDDW. Can I filter the dddw to include only valuesthat have NOT already been selected ?

Answer:
There is a short, a long and a longer answer to this question. The shortanswer is no. The long answer is that it depends on what your drop-downDataWindow looks like.

Let me give you some background information:

The problem with DDDWs is that the same data buffer is used to displaythe data for each row of the parent DataWindow. This is great forkeeping memory usage low, and 95 percent of the time is exactly what you want.

If you are filtering a DDDW with a single parent row of data you do nothave any problems. The problem comes when you have many rows and eachrow needs a slightly different view of the data. Because the data bufferis shared between the row, whenever you change one row you change themall.

Although your users can edit only a single row at any given time,whenever you update the primary buffer of the DDDW, PowerBuilder repaintsall of the views of that data buffer. This is exactly the same concept asthe ShareData command.

Because the DDDWs are repainted when you filter the data, any otherrows are repainted. Thus if your drop-down list box is showing a nicetextual version of a code table, when you filter the rows and removethe already used rows out of the data set, the textual version ofthe other rows is gone and is replaced with the code!

So the long answer is that if you are not displaying textualdescriptions and code only, it will work.

The longest answer is that you can write a lot of code and basically fakethe missing DDDWs. Have an empty text column on your data window andmake it the same size as the DDDW. When your users tab into the DDDW, letthem use it as normal. When they tab out, find out what theyselected and look up the text out of the DDDW. Then put the text in yourdummy column and move the dummy column over the top of the DDDW. Whenthey tab into the DDDW, move the text field out of the way. This willtake an hour or so of coding and testing but will give you the desiredeffect. The commands to look at are GetChild, SetFilter and Filter,as well as the itemfocuschanged event. To add a dummy column, just add “” to the end of your SQL statement.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS