For Programmers: Free Programming Magazines  


Home > Archive > PowerBuilder > April 2005 > How to determine if a dwobject has a property









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to determine if a dwobject has a property
Hitman_in_Wis

2005-04-25, 8:57 pm

Im looking to write some security level functions such as of_enable,
where I can pass in a dwobject, and depending on security, the function
will enable or disable the object.

How can I check a dwobject to see if it has an "Enabled" property in
the first place? Otherwise, my program is going to go BOOM if I pass
in an object without an Enabled property and try to set it :)

Thanks!

GWood

2005-04-26, 8:58 pm

Well, if I were starting this project, I would create a parent class
decended from datawindow, and add the required functionality to the parent
class. Then the application DWs would in turn be decended from this parent
class. You would be able to enable/disable the DW by using a function
integrated into the DW class.

To do it after the fact, it would depend on what you envision as "enable" or
"disable". There is such a property (boolean) on the datawindow object that
would not allow the object to be selected, but I expect you know that and it
doesn't do what you want?

Alternate methods might include writing a function that would spin thru the
columns in a DW and conditionally "turn off" any columns that allowed
updates. i.e. use the dw.modify approach to alter the tab order or
updateable property of the dw columns?

It really depends on the behavior you wish to present to the application
user.


"Hitman_in_Wis" <brett.birschbach@cellcom.com> wrote in message
news:1114452475.341889.281170@o13g2000cwo.googlegroups.com...
> Im looking to write some security level functions such as of_enable,
> where I can pass in a dwobject, and depending on security, the function
> will enable or disable the object.
>
> How can I check a dwobject to see if it has an "Enabled" property in
> the first place? Otherwise, my program is going to go BOOM if I pass
> in an object without an Enabled property and try to set it :)
>
> Thanks!
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com