Link to home
Start Free TrialLog in
Avatar of kandura
kandura

asked on

PowerBuilder: protect column row-by-row

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
ASKER CERTIFIED SOLUTION
Avatar of runebj
runebj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of runebj
runebj

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
Avatar of kandura

ASKER

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?
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
Avatar of kandura

ASKER

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