Advanced UI Patterns Exercise (Developing Web Apps)

I can't see the logical use of the function List_Navigation_GetStartIndex()

Upon clicking the navigation buttons, the movies list aggregate is refreshed, tablerecords ajax refreshed, and the navigation widget is refreshed, but I can't see the logical connection of how navigation widget is linked to List_Navigation_GetStartIndex() to keep records or generate the start index of each navigation sub-section in the list records.

Please help see the logical connection between the navigation widget and the List_Navigation_GetStartIndex() function, and the logical working of List_Navigation_GetStartIndex(), and how the start index is generated and linked to each navigation sub-section.

Hi David,


Here's what I can find:

1. Yes, exactly. This is what I see in the code:

2. Yes, as you can see here, clicking on the button will launch Page action with a different NextPageStartIndex:

Which will ultimately store it in session as you figured:

3. A new page will load, so the preparation action will run again, using "Session.ListNavigation_RememberStartIndices" (see screenshot 1) (remember, value has been modified after click on the button - see screenshot 3) to set "StartIndex". Just after setting "StartIndex", "PageNumbers" is set (see screenshot 1) so it also depends on what was saved in "Session.ListNavigation_RememberStartIndices".

This variable is given to the "PageNavigator" to generate the buttons:

And this is what we see used in the ajax submit on click action of the button (see screenshot 2).


So what you described seems all correct to me :)

Additionally, I don't know if you realized you can access this source code too, just right-click on List_Navigation widget and select "Open in RichWidgets module":


Happy we could figure this out :)

Yes, I saw the 'open in richwidgets module' option from where I then gathered what I reckoned and wrote in my earlier reply.

Thank you much Maxine for taking the trouble to explain step by step with screenshots. Totally helpful to help connect the dots which is much important to me so to get a solid grasp on the foundational principles of developing using outsystems. (not really into just following standard instructions given in the course material)

Much gratitude one again.


Hi David,

Look at the example given in this exercise to learn by practice ;)


https://www.outsystems.com/learn/lesson/868/scaffolding-and-richwidgets-exercise/


Maxime, I seek and explanation of the logical connection navigation widget and the List_Navigation_GetStartIndex() function. I can't see how they are connected and how the List_Navigation_GetStartIndex() function works because it is set somewhere separate.

I have enough exercises for practice but still can't see what I am looking for.

Hi David,


Ok, here's what I could see in the linked material:


To reflect the user changing pages using the List_Navigation, it is necessary to set the Start Index using the List_Navigation_GetStartIndex Action. This defines the correct records to show, considering the page selected in the List_Navigation and the Line Count of the Table. For example, with a Line Count of 10, selecting page 2 in the navigation, should display first the eleventh record. Otherwise, the records that appear are always the same, regardless of the page selected by the user.


So back to your question, the logic is a combination of line count and pagination to find the correct position within the whole list.


Does it help or am I still missing the point?

Hello Maxime! Firstly, much thanks for your efforts to help.

The text you sent is also present in the OSDMb learning-course exercise material. And what it does is just explain the PURPOSE for the use of the action List_Navigation_GetStartIndex, but NOT THE SPECIFICS OF HOW IT WORKS.

What I seek to find is the specific details of how it works, because that can help me understand the underlying workings of the platform and it's built-in actions, instead of just learning procedures how to use certain actions.

This is what I see the flow of logic now:

  1. OnClick any navigation links (navigation page numbers), the OnNotify screen action is triggered.
  2. The scree action refreshes the aggregate list, then ajax refreshes the table records widget, then ajax refreshes the List_Navigation widget.
  3. Upon the table records widget being ajax refreshed, the Start Index is dynamically gotten using the List_Navigation_GetStartIndex action
  4. Upon the action List_Navigation_GetStartIndex being triggered, a new integer is returned into the table records property 'Start Index'..... HOW?

What I can't see is how the List_Navigation widget, and the action List_Navigation_GetStartIndex are connected, and thereby can't see how the action List_Navigation_GetStartIndex returns the integer value based on the page number clicked in the List_Navigation widget.

In short, I desire to see and understand how the action List_Navigation_GetStartIndex works and returns the correct integer when the appropriate page number in the List_Navigation widget is clicked.


Hi David,


Ok, did you look at this? (used only in the preparation of list_navigation widget by the way, so the appropriate page number is calculated for each button and stored at this step)


Ah yes, now this helps connect the dots.

  1. The action List_Navigation_GetStartIndex is used in the preparation of the List_Navigation web-block/widget.
  2. Therefore upon loading the List_Navigation widget, the action List_Navigation_GetStartIndex is triggers and is programmed to set the start index integer value in a session variable based on the page number link clicked.
  3. The session variable value is then loaded into the Start index property of the table records widget again using the action List_Navigation_GetStartIndex

Do I see this correct now?


Hi David,


Here's what I can find:

1. Yes, exactly. This is what I see in the code:

2. Yes, as you can see here, clicking on the button will launch Page action with a different NextPageStartIndex:

Which will ultimately store it in session as you figured:

3. A new page will load, so the preparation action will run again, using "Session.ListNavigation_RememberStartIndices" (see screenshot 1) (remember, value has been modified after click on the button - see screenshot 3) to set "StartIndex". Just after setting "StartIndex", "PageNumbers" is set (see screenshot 1) so it also depends on what was saved in "Session.ListNavigation_RememberStartIndices".

This variable is given to the "PageNavigator" to generate the buttons:

And this is what we see used in the ajax submit on click action of the button (see screenshot 2).


So what you described seems all correct to me :)

Additionally, I don't know if you realized you can access this source code too, just right-click on List_Navigation widget and select "Open in RichWidgets module":


Happy we could figure this out :)

Yes, I saw the 'open in richwidgets module' option from where I then gathered what I reckoned and wrote in my earlier reply.

Thank you much Maxine for taking the trouble to explain step by step with screenshots. Totally helpful to help connect the dots which is much important to me so to get a solid grasp on the foundational principles of developing using outsystems. (not really into just following standard instructions given in the course material)

Much gratitude one again.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.