List to Another Page

hello, I have a list with two fields: id, name and a detail button,

How do I make it so that when I click on the button, I take the selected data to another page with a form and with the name fields, as if I were a change form?

I looked in the tutorials here, but I didn’t find anything similar, just a few passing url parameters, but not to another page, I would like to know how to do this in wappler.

thanks.

  1. Use an on-click event to go to another page using the Browser component. Add the id of the record as a URL parameter.
  2. On the other page, use the URL parameter to filter the database on the record id.

see:
Wappler Documentation - Filtering Database Query with an URL Parameter
and:
Define URL Parameters · Wappler/docs Wiki (github.com)

do you have any example of this process?, because it does not seem to be that simple, because in the inputs of the other form I will have to show the records of the id of the selected list.

thanks Ben.

Working on an example now.

2 Likes

It’s people like you that motivate me to use Wappler every day.

no words to thank :handshake:

  1. I always start with the heart of the project, called database. This is what the database looks like where I have chosen the Employees table.

  1. Then I create the server actions so that I can use these for the front end. This is the read action.

and the filtered (single) read action.

This has a condition that the employee id is the same as the URL parameter ($_GET variable)

The update action is a dummy. I presume that you know how to create this.

  1. The layout page gets a Query Params assigned to it. If your project is not NodeJS based, then assign the parameter to the details page.

  1. Add the two pages, one for the list and one for the detail.

  1. Adjust the routing to show the parameter for the details page.

  1. A browser component and a data source is added to the employees page. A table showing the employees is added using generators. The row containing the employee gets an on-click event, the action is to go to the details page with the emplyee id as the parameter.

  1. The details page gets a data source added to it, this is the filtered read function with the query id as the filter.

  1. Using generators, an update form is created populated by the data source.

If all has gone well, the result will be, when I click on a name

I get taken to the details page.

2 Likes

This may also help, it explains routing and using parameters

1 Like

thank you very much ben. :handshake: :pray:

actually i was doing everything right, only what was wrong was the location of my url parameter variable, with your video i figured that out.

thank you very much.

1 Like

@ben and @Hyperbytes are two of the greatest assets on this forum.

5 Likes

Agree wholeheartedly. Have been a grateful recipient of their selfless largesse on more than one occasion.

Bless their generous souls.

Thank you @ben and @Hyperbytes

1 Like