Progress
AppBuilder
Developer’s Guide


Scrolling to the Last Record in the Data Stream

Conventionally, the size and position of the thumb slider within a scrollbar provides the user a hint about the overall size of the document being examined, and the position of the viewport within that document. The ratio of thumb size to scrollbar size indicates how much of the whole document is currently visible. The position of the thumb within the scrollbar’s length represents how far the visible portion is from the beginning and end of the document.

In the case of the SmartDataBrowser and its basic counterpart, the document being examined is actually a data stream. Typically, that data stream will contain many records. Many more records, in general, than are practical to buffer. But if there are more records than are buffered, the size and position of the thumb will reflect the buffer, not the whole data stream. Moving the thumb to the bottom of the scrollbar track brings into view the last record in the buffer, not the last record in the data stream.

This can be confusing to the user of your application.

Follow these steps to fix the problem in your SmartDataBrowser:

  1. Click the SmartDataBrowser’s menu button and select Instance Properties. That dialog box opens:
  2. Set the Scroll Remote Results List check box.
  3. Save your work.

If you have a trigger defined for the ROW-DISPLAY event, you must modify it. Follow these steps.

  1. Click the menu button and choose Edit Master. The master workspace opens (its appearance may be different):
  2. Select the workspace if necessary and open a Section Editor window. Create a new procedure, for example OldRowDisplayHandler, and move the code from your ROW-DISPLAY handler into the new procedure.
  3. Create a new function as an override for rowDisplay. Put in it a call to the procedure you just created, followed by a RUN SUPER statement. If you name your procedure OldRowDisplayHandler, your function body would look like this:
  4. RUN OldRowDisplayHandler . /* run original local code */ 
    RUN SUPER .                /* run the handler in the super procedure*/ 
    

  5. Open your local ROW-DISPLAY trigger in the Section Editor. It should now have no code in it, because you moved that code to the new procedure you created.
  6. Add this line as the new body of your local trigger:
  7. RUN rowDisplay. /* run local override of super-procedure handler*/ 
    

  8. Save your work.

Now, when the user drags the thumb to the bottom of the scroll bar, bringing the last record in the buffer into view, the Browser requests a new batch of records from the Data-Source. When the new batch is received, the Browser repositions its thumb to account for the new total record count. Thus, the first time a new batch is requested, the thumb will in general reposition to the middle of the scrollbar because the former last record is now in the middle of the buffer. The second read will create a total of three batches, with the thumb positioned at the two-thirds point, and so forth.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095