1. Deva Shanmuga
  2. PowerBuilder
  3. Wednesday, 5 June 2024 09:48 AM UTC

Hi Experts,

How can I use the DataWindow object (DWO) outside of a DataWindow? Specifically, if I need to retrieve the name of a selected column in a DataWindow from outside of it, how can I achieve this?

Thanks

Deva.S

Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 5 June 2024 12:33 PM UTC
  2. PowerBuilder
  3. # 1

When you click on a DataWindow button, the buttonclicked event is triggered. The argument 'dwo' is a reference to the object you clicked on. The name of the object can be accessed via dwo.Name.

Comment
  1. Roland Smith
  2. Wednesday, 5 June 2024 13:18 PM UTC
You can add the code to your ancestor DW Control object. That would allow it to be reused.
  1. Helpful 2
  1. René Ullrich
  2. Wednesday, 5 June 2024 13:31 PM UTC
You can also write a window function that takes a parameter of type dwobject. But you have to call this function from the buttonclicked event in the datawindow control. Without code in the datawindow control it will not work.
  1. Helpful 1
  1. Roland Smith
  2. Wednesday, 5 June 2024 20:04 PM UTC
With a Window function, you would have to pass the DW control as well as dwobject because they want to share this code with more than one DW control.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 5 June 2024 11:09 AM UTC
  2. PowerBuilder
  3. # 2

Hi Deva;

  I am guessing that your asking about using a DWO outside of it's container the DW Control. If that's your question, then have a look at the DataStore object class.   HTH 

Regards .... Chris 

Comment
  1. Deva Shanmuga
  2. Wednesday, 5 June 2024 12:15 PM UTC
Hi Chris Pollach,



Yes, you are correct. I need to use the DataWindow object (DWO) outside its container. Specifically, I have two buttons inside DataWindow, and I need to determine which button was clicked.



Thanks

Deva.S
  1. Helpful
  1. David Peace
  2. Wednesday, 5 June 2024 15:52 PM UTC
In the DW button clicked event this information will be available to you. You could then trigger an event on the Window/UO passing the button name.
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Wednesday, 5 June 2024 20:05 PM UTC
Either way . the DWO *cannot* exist outside of a "container" for any processing to happen. ;-)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.