Solved

PowerBuilder: protect column row-by-row

Posted on 2000-03-09
5
2,149 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
ID: 2599890
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
ID: 2599903
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
ID: 2600104
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
ID: 2600311
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
ID: 2600361
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 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

23 Experts available now in Live!

Get 1:1 Help Now