?
Solved

PowerBuilder: protect column row-by-row

Posted on 2000-03-09
5
Medium Priority
?
2,271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
runebj earned 200 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

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