Solved

PowerBuilder: protect column row-by-row

Posted on 2000-03-09
5
2,116 Views
Last Modified: 2012-06-27
I've been trying some time now but i can't find the solution: in a dw i have two dddw columns. By certain values of the first one the second one has to be disabled, but i want to disable it for only that one row in which those values are chosen. E.g. i have cars in the first dddw and extras in the second. If you choose 'x' car in the first dddw of the first row, it has no extras, so the second dddw in the same row has to be protected, but not for the other rows. The first dddw has a string column, "y"/"n", that's what the protected property should be depending on.

I've tried conditional statements in the protect property of the dddw column, but it doesn't seem to work with variables.  I wonder if something like this is possible at all. I'm using PB 6.5.

thanks,
kandura
0
Comment
Question by:kandura
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
runebj earned 50 total points
Comment Utility
Sure it's possible. I think your problem is due to the fact that you want the second column to be protected based on the value in another DDDW. To fix the problem copy the "Y/N" value from the first DDDW whenever that changes to a hidden column and base the protected expression on that column. Btw. protected expects a "0" (zero) as a "false" value and a "1" (one - nonzero) as "true".

runebj
0
 
LVL 1

Expert Comment

by:runebj
Comment Utility
One more thing...

If the "extras" vary from car to car - that is if you want different values in the second DDDW based on the value of the first - the solution is different. Let me know if that is the case.

runebj
0
 
LVL 18

Author Comment

by:kandura
Comment Utility
Nope, the second column always stays the same, the "extras" example was not a perfect one.

But i've tried your suggestion quickly just using one of the existing columns, and boy does it work. (: So i'll have that hidden column made. Great tip, thanks.

I keep wondering where one can find this sort of info, e.g. that in the "If(IsNull(x),1,0)" expression you work with columnnames instead of variables. Is it really in the help, because i couldn't find it. Can you recommend some good documentation?
0
 
LVL 1

Expert Comment

by:runebj
Comment Utility
Regarding documentation for PowerBuilder: That depends on your level of PB expertise. The big key to PB are the DataWindow *objects* (the ones you define in the DW painter). When you master those and also know how to use the DataWindow *control* (the "container" you put in a window) then you will understand the Power part of PowerBuilder. I'm sorry I don't have any titles to give you but check out Amazon - they have a number of books on PB.

Regarding columns vs. variables: In a DataWindow *object* you only work with values defined in the DW painter. That is any SQL columns (including computed SQL columns) or DW computed columns you can define in the DW painter. Everything else is "out of scope" for the DW *object*. Even though this may seem like a limitation - it's of great value the day you discover that you can display and use hundres of well designed DW's in the same window without changing code (or adding a little code to a inherited window).

A very good example of this is to have a "reporting" window with a preview of any report loaded at runtime directly from any PBL (created in PB or IM). One window - hundres of reports - all functionallity in the DWs. (I'll leave the rest of the babbeling until you want to make such a window :-))

runebj
0
 
LVL 18

Author Comment

by:kandura
Comment Utility
That time will definitely come one day. Thanks, i'll have a look around at Amazon. My expertise is not on a very high level, (but i guess that was clear from my question :), but i'm working on it.

See you in the next one (:
kandura
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

11 Experts available now in Live!

Get 1:1 Help Now