Skip to content

Applying Dynamic Paging

Original guide · All levels · Server Connect

You can add paging to your dynamic data, using the paging generator included in Wappler. First, you need to create a server action: And add a name for it. We call it - records_paged: Right click steps

You can add paging to your dynamic data, using the paging generator included in Wappler.
First, you need to create a server action:

And add a name for it. We call it - records_paged:

Section titled “And add a name for it. We call it - records_paged:”

Select your database connection or create a new one, if you have not defined one yet:

Section titled “Select your database connection or create a new one, if you have not defined one yet:”

Then right click database connection step (1) and open the database actions menu (2):

Section titled “Then right click database connection step (1) and open the database actions menu (2):”

Then select the tables you need and click the add button:

Section titled “Then select the tables you need and click the add button:”

Then click the select server action button:

Section titled “Then click the select server action button:”

Here we select the server action with the paged database query which we just created:

Section titled “Here we select the server action with the paged database query which we just created:”

We add a dynamic table, displaying our records on the page. Make sure to select the data object, under database query as an expression for it:

We are going to define a query parameter, which will store the current paging state. This way the current page won’t be lost on page refresh:

Then select the server connect component (1) and click the dynamic data picker for the offset parameter (2):

Section titled “Then select the server connect component (1) and click the dynamic data picker for the offset parameter (2):”

Bind the query parameter called offset which we just created:

Section titled “Bind the query parameter called offset which we just created:”

We right click the table, displaying our records:

Section titled “We right click the table, displaying our records:”

This is our paged query, located in the server connect component:

Section titled “This is our paged query, located in the server connect component:”

Open the state manager drop-down and select the state management component which we created:

Section titled “Open the state manager drop-down and select the state management component which we created:”

Then select the offset query parameter from the offset menu:

Section titled “Then select the offset query parameter from the offset menu:”

You can see the paging in design view and in the app structure. It can be edited by clicking the Run button:

Section titled “You can see the paging in design view and in the app structure. It can be edited by clicking the Run button:”