4
votes

I have a master-detail datawindow. In the detail window, when user clicks on a row, I am opening another datawindow as a Pop up datawindow which is positioned just below the row on which the user clicked. It works fine as long as there are less that 11 rows in the detail window. When the window contains more than 11 rows and the user clicks on a row from lower region, the popup isn't placed where it's supposed to be.

My guess is that when the user clicks on a row in the lower region, the window is scrolled to the bottom and some rows gets hidden as a result of scrolling. If two rows gets hidden as a result of scrolling, the popup is opening tow rows below the desired row. My positioning logic is as below -

// "parent" is the user object that contains the datawindow 
// "row" contains clicked row number
// "this" points to the detail datawindow

ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * (row) ) + parent.y

How can I resolve this problem?

1
Why is powerbuilder community so small? If I have asked anything about JQuery/.NET/PHP, there would have been at least 2-3 answers by now :-(MD Sayem Ahmed
There simply aren't many people using Powerbuilder I'm afraid. We're a dying breed :(Colin Pickard
@Colin Pickard: That's really sad :'( :'( :'(MD Sayem Ahmed
Might have something to do with Sybase pushing peer support to their own newsgroups, so StackOverflow isn't where the community focuses. Besides, I only saw this asked and answered over a short duration on the weekend; a lot of people do peer support on weekdays.Terry

1 Answers

5
votes

I've got the solution. The trick is to use FirstRowOnPage property of the detail datawindow and use it to determine the y position -

ll_first_row =  long( this.Object.DataWindow.FirstRowOnPage)
ll_row = row - ll_first_row + 1
ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * ll_row ) + parent.y