Solved

PowerBuilder: protect column row-by-row

Posted on 2000-03-09
5
2,213 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dynamically Growing Sybase Database 3 457
Work with Sybase data using SQL Server 2008 7 432
compare Sybase and MSSQL server 18 1,006
Problems writing binary files to Sybase from PHP 2 196
A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

732 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