ScrollNextPage

Scrolls to the next page in a DataWindow.

To scroll

Use

To the next group of rows in a DataWindow (when the DataWindow does not have the RichTextEdit presentation style)

Syntax 1 For DataWindow controls and child DataWindows

A RichTextEdit DataWindow to view the next page within the document (PowerBuilder only)

Syntax 2 For RichTextEdit DataWindows


Syntax 1 For DataWindow controls and child DataWindows

Description

Scrolls a DataWindow control forward one page, displaying the next group of rows in the DataWindow’s display area. (A page is the number of rows that can be displayed in the DataWindow control at one time.) ScrollNextPage changes the current row, but not the current column.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object

Web

Client control

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

PowerBuilder

long dwcontrol.ScrollNextPage ( )

Web DataWindow client control and Web ActiveX

number dwcontrol.ScrollNextPage ( ) 

Argument

Description

dwcontrol

A reference to a DataWindow control or child DataWindow

Returns

Returns the number of the row displayed at the top of the DataWindow control when the scroll finishes or tries to scroll past the last row. ScrollNextPage returns 1 with nested or composite reports and child DataWindows since, in these cases, the current row cannot be changed. ScrollNextPage returns –1 if an error occurs.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

ScrollNextPage does not highlight the current row. Use SelectRow to let the user know what row is current.

For an example that uses RowCount and Describe to check whether the user has scrolled to the last page, see RowCount.


Web DataWindow

Calling ScrollNextPage causes the page to be reloaded with another set of rows from the result set.

If the DataWindow object has retrieval arguments, they must be specified in the HTMLGen.SelfLinkArgs property. For more information, see the HTMLGen.property, the Retrieve method, and the DataWindow Programmers Guide.

All methods that reload the page perform an AcceptText before sending data back to the server. If the method fails (returns –1), this means that pending data changes were not accepted and nothing was sent back to the server. In this situation the ItemError event occurs.


Events

ScrollNextPage can trigger these events:

Examples

Example 1

This statement scrolls dw_employee forward one page:

dw_employee.ScrollNextPage()

See also


Syntax 2 For RichTextEdit DataWindows

Description

Scrolls to the next page of the document in a RichTextEdit DataWindow.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control

Syntax

PowerBuilder

integer rtedwname.ScrollNextPage ( )

Argument

Description

rtedwname

A reference to a DataWindow control. The DataWindow object in the DataWindow control must be a RichTextEdit DataWindow.

Returns

Returns 1 if it succeeds and -1 if an error occurs. If rtedwname is null, in PowerBuilder and JavaScript the method returns null.

Usage

A RichText DataWindow contains multiple instances of the document, one instance for each row. When the last page of the document for one row is visible, calling ScrollNextPage advances to the first page for the next row.

NotePowerBuilder RichTextEdit control You can use the same syntax with a PowerBuilder RichTextEdit control. See ScrollNextPage in the PowerScript Reference.

Examples

Example 2

This statement scrolls to the next page of the RichText document in the DataWindow control dw_rpt. If there are multiple instances of the document, it can scroll to the next instance:

dw_rpt.ScrollNextPage()

See also