1. Frank Zettanucci
  2. PowerBuilder
  3. Sunday, 21 January 2024 19:50 PM UTC

I have a 8 NUP datawindow which returns hundreds of rows

The way the data represents onscreen is 8 results per row and the datawindow is sized so that 3 rows per screen is shown.

I have a VCR like button to navigate between the 'pages' and this text label will show them what page # of #pages they are on.

Example:  547 Rows yields 23 pages worth. First 22 pages are 24 per onscreen page and then 19 on final page.

I created a computed field on the datawindow to show the PageAbs() absolute page # which works,

string ( PageAbs() ) + " / " + string ( PageCount() )

However, It shows the PageAbs() on each of the 3 rows of 8 , how can i prevent the 2nd and 3rd copies of the value from showing / visible ?

Users only need to see the #currentPage / #Pages only once.

Frank,

 

Frank Zettanucci Accepted Answer Pending Moderation
  1. Monday, 22 January 2024 01:53 AM UTC
  2. PowerBuilder
  3. # 1

Image would have been so greatly redacted i thought the description would be better...

However, your solution was bang on, seem to be the right way ... Since its so simple... kinda of what I was trying to do...

I had came up with a convoluted way to do it ....

if ( PageAbs() > 1,
   if (
       ((PageAbs() - 1) * 24 ) + 1 = getrow(), 1
       , 0
      )
,
if( ( PageAbs() = 1 ) AND GetRow() = 1, 1, 0 )
)

BOTH solutions introduces a different problem,

However ... After applying the following Sort / Scroll To Row Solution ...

dw_1.Setsort(ls_null) // reset sort
ll_row = dw_1.Find("left(searchCOLname,1) = '"+ls_part+"'", ll_row, dw_1.RowCount())
IF ll_row > 0 THEN
        // Row found, scroll to it and make it current
        dw_1.SelectRow( 0, FALSE )
        IF ll_row > 0 THEN
          dw_1.ScrollToRow( ll_row )
        END IF
END IF
dw_1.SetRedraw(TRUE)

The display of the 1 / 24   CurrentPg / TotalPages ... is... a bit wonky looking...

I appreciate the ideas and help and wouldnt ask the community if i could figure it out...

Maybe there are some pb function names i dont know about that could do this...

Frank

Comment
  1. Miguel Leeuwe
  2. Monday, 22 January 2024 05:07 AM UTC
[Edit]: removed my comment as I was wrong.
  1. Helpful
  1. Markus Eckert
  2. Monday, 22 January 2024 12:16 PM UTC
I see two options to deal with the "wonkyness":



1. Use the following formula for the visible property of the page counter: if( getrow() = Long( describe( "DataWindow.FirstRowOnPage" ) ), 1, 0 )

2. Instead of scrolling to the found row, scroll to the 1st, 25th, 49th, etc. row instead to make sure you land at the proper start of the page.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Sunday, 21 January 2024 22:40 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Frank -

Due to the complexity of what you are describing, this is a prime example where a screen shot would be extremely helpful.

If I understand what you have described, each n-up "row" of eight results contains a computed field that displays the page count, and since there can be three n-up "rows" in each scrollable/viewable page in the DataWindow control, the user sees three occurrences of  "Page n of 23" in each one of the three n-up rows - and you only wish to have this appear once.

You may wish to try putting an expression on the visible property of the page count computed field, so that it is visible only when the data/result row number modulo 24 equals 1 (row 1, 25, 49, 73, 97, etc.)... something like: If( Mod(GetRow(),24)=1, 1, 0)

Best regards, John

Comment
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.