axScrollableSubfileTable

Description

axScrollableSubfileTable adds the functionality to view multiple pages of subfile records on the screen. Originally, only one page of subfile records can be viewed on the screen and this limits the user’s viewing of subfile records per page, without having a complete view of the whole subfile.

With axScrollableSubfileTable, multiple pages of subfile records can be loaded into the screen therefore allowing the user to view more records at the same time. Using the properties described below, the user can customize how the subfile records can be loaded.

Usability

Context Supported

Input screen fields

No

Output screen fields

No

Input subfile fields

No

Output subfile fields

No

New screen elements

Yes

Properties

Name

Description and Comments

JavaScript

Shipped default

bodyFirstRow

The first row of the body of the subfile.

Yes

0

bodyLastRow

The last row of the body of the subfile.

Yes

0

headerHeightRows

Number of header rows for the subfile.

Yes

1

highlightRows

Indicates that a stripe be created for each row of the subfile rather than for the whole body.

Yes. Must return a Boolean.

False

alternateColors

Indicates that rows should be highlighted with alternate colors (ignored if highlightRows is False).

Yes. Must return a Boolean.

False

columnFirst

The first column of the subfile.

Yes

0

columnlast

The last column of the subfile.

Yes

0

initialNoOfPages

The number of pages that will be loaded on the first display of the screen.

Yes

1

linesPerRow

The number of screen lines that represents a subfile row.

Yes

0

loadFromFirstPage

Indicates whether to load from the first page when the current page in the screen is not the first page.

No.

False.

showExportLink

Indicates whether the export link or button is displayed or hidden.

No.

Hide.

scrollBarAtTop

Indicates whether the scrollbar will initially be positioned at the top for multiple pages.

No.

True.

subfileName

Name or record format of the subfile.

Yes. Must return a string.

FIRST

Notes, Comments and Warnings

This extension is intended to be used for TS2 development only. Its behaviour and functionality is not guaranteed in TS1.

In addition, it automatically looks for subfile defined in the screen. Customization of the subfile properties such as start row, end row, etc. is not supported. Only those defined for the screen can be processed and detected.

Since this extension when used will take control of most of the keyboard and event processing of the screen, some normal subfile behaviours may not work. For example, when viewing multiple pages of subfile records on popup windows, only the last page’s subfile records can handle any click and/or double-click events that were binded to it. That is why using this extension on popup windows is not currently supported and can be used at your own risk.

This extension should not be used simultaneously with other extensions that access subfile on the screen such as the axSubfileEnhancer.

The styles of the table is based on basic jQuery theme classes. All style will change according to the current jQuery theme that is set.

For any other specific issues that may arise, please consult the aXes Team.

initialNoOfPages property

The initialNoOfPages property can be used if at the initial display of the screen, the user already wants multiple pages of subfile records to be displayed. When this property is set to any number greater than 1, the subfile records that will be displayed will start from the current page of subfile up to the next succeeding initialNoOfPages. For example, if the current page of subfile records initially displayed is the 2nd set, and the initialNoOfPages is set to 2, then 2nd, 3rd and 4th pages of subfile records will initially be displayed on the screen. Therefore, initialNoOfPages will not necessarily start from the 1st page of subfile records.

loadFromFirstPage property

If this property is set to true, the screen will always be displayed from the 1st set of subfile records. This means that if the initial set of subfile record for the screen is the 3rd set, when this property is set to true, the 1st, 2nd and 3rd set of subfile records will be displayed on the screen.

Examples

Default settings

Create a new project in aXes and open it in Developer mode.

At the command line, type the following command:

addlible axesdemo

call xhrrpgtrn

The Maintain Employee Information screen will be displayed.

Lock the screen and add the Scrollable Subfile Table extension into the screen.

The extension’s default properties are as follows:

Image

Note: The extension will not be visible during lock mode.

Save and unlock the screen, leaving the default settings as is. The subfile will be displayed with a new look and a scrollbar at the right.

Image

Using the visual properties

Set the highlightRows property of the extension to true.

Image

Save and unlock the screen. The rows of the subfile will be displayed with highlights.

Image

Set the alternateRows property of the extension to true.

Image

Save and unlock the screen. The rows of the subfile will be displayed with highlights and alternating colors.

Image

The colors of the highlight and alternating colors depends on the jQuery Theme CSS classes ui-state-highlight and ui-widget-content.

Note: The alternateRows property will not be applied if the highlightRows property is set to false.

Using initialNoOfPages

For this example, make sure that you currently on the first page by pressing PageUp multiple times on the Maintain Employee Information screen. The first page should contain the following records.

Image

Lock the screen and set the initialNoOfPages property to 2.

Image

Save and unlock the screen. The screen should display 2 pages of subfile records starting from the 1st page.

Image

Press the PageDown key or scroll using the mouse and you will be able to see the 2nd page.

Image

Lock the screen again. The 2nd page should be the one visible on the lock mode.

Image

Unlock the screen. The 2nd and 3rd pages should be displayed.

Image

From this example, the initialNoOfPages starts from the current page and not necessarily from the first page of the subfile records.

Using loadFromFirstPage

Set the extensions properties as follows (Make sure you are at the first page):

Image

Unlock the screen. The 1st page should be displayed.

Image

Press the PageDown button. The 1st and 2nd page will be loaded.

Image

Lock the screen again. The 2nd page should be displayed.

Image

Unlock the screen again. The 1st and 2nd page will be loaded.

Image

PageUp and PageDown

Set the extensions properties as follows (Make sure you are at the first page):

Image

Unlock the screen. The 1st page should be displayed.

Image

Press the PageDown button two times. The 1st, 2nd and 3rd page will be loaded.

Image

Pages are being added at the end of the table as you press PageDown. This will continue until the last records are fetched.

Lock the screen again. The 3rd page should be displayed at locked mode.

Image

Unlock the screen again and the same page will be displayed.

Image

Press PageDown and the 4th page will be added after the 3rd page.

Image

Scroll using the mouse until the scrollbar reaches the top then press PageUp.

The 2nd, 3rd and 4th page will be displayed.

Image

Continue pressing PageUp until the 1st page is displayed. The loading should stop when the 1st page is reached. Then press PageDown again until the scrollbar reaches the bottom. After the scrollbar reaches the bottom, pressing PageDown again will load the next page after the last page that was loaded.

This is how the loading of the subfile records behave when using the PageUp and PageDown keys.

Editing

With multiple pages loaded inside the extension, after doing example number 5. Try selecting some records for editing by typing some characters inside the input boxes.

First click on any input boxes. The cursor/caret should be displayed inside the input box. Type any character. After typing one character, the cursor should move to the next input field. This behaviour will depend on the settings of the subfile. Tabbing and using the arrows keys inside the input boxes should also work.

Now select multiple records from multiple pages. For example, one record for each page.

After selecting records, press the ENTER key. The screen should change to the Maintain Employee Information edit screen with one of the selected record displayed.

Image

Pressing the ENTER key will display the next selected record until all the selected records are displayed. After which the screen will return to the Maintain Employee Information list screen.

Administrators

Legal Mentions

aXes is brought to you by:

LANSA

Serving the IBM i community for 30 years.