-
Reece D
- PowerBuilder
- Friday, 10 April 2026 11:21 AM UTC
We have a composite DataWindow made up of 8 sub-DataWindows aligned vertically. It effectively functions as a report, displaying data from multiple areas of our system.
When a user double-clicks a row in the report, we attempt to redirect them to another part of the system based on where the click occurred.
Our current approach is:
- Use dwo.Name to determine which sub-DataWindow was clicked (to decide which area to redirect the user).
- Use DataWindowChild.GetBandAtPointer() to determine the row (to decide exactly where in that area to redirect to).
However, we’re encountering an issue where the wrong DataWindow object is sometimes passed into the DoubleClicked event. For example, if we double-click near the bottom of dw_1, the dwo received in the event is actually dw_2.
Here’s a simplified version of the code in the DoubleClicked event (I've trimmed it down/removed irrelevant code, including some safety checks etc):
DatawindowChild ldwc_child
dw_composite.GetChild(String(dwo.Name), ldwc_child)
String ls_objectname
ls_objectname = ldwc_child.GetBandAtPointer()
Long ll_row
if Left(ls_objectname, 1) = "d" then
ll_row = Long(Mid(ls_objectname, 7, Len(ls_objectname)))
end if
if ll_row > 0 then
// redirect user based on clicked sub-datawindow and row
end if
Has anyone run into this before? Is there a better/more reliable way to determine which sub-DataWindow and row were actually clicked?
For context (in case relevant):
- Each sub-datawindow has autosize height enabled.
- We’re using PowerBuilder 2022 (Build 1900).
Any insights would be appreciated!
Cheers
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.