I created a page with dynamic table (columns: ‘name’ and ‘phone’) linked to the database (dataset:Client) and a second page for editing the data with 2 fields ‘name’ and ‘phone’ linked to dataset (client)
In the table there are 10 names with their respective phones.
By clicking on any name, PETER for example, I’d like to go to the editing page showing PETER.
What has happened: By clicking on any name, I’m directed to the editing page that I’ve created, but I’m not directed to the same record as the one I clicked, but rather to the last record, and no ‘peter’
I’m guessing that the editing pages are dynamic pages.
You table probably has a link set (or maybe onRowSelect ).
Anyway, you can achieve that using onRowSelect, and wixLocation.to :
< Hmmm, just noticed that Liran answered just before I did. He’s approaching it through code, and my approach was through settings. Take your pick. >
Welcome to WixCode. Glad to have you aboard.
Maybe the best thing would be to go through some sort of checklist. I am making some assumptions, just for sake of argument, regarding names of elements/collection/dataset/etc. You can post your completed checklist with the correct names. The main idea here is to ensure that you have everything you need.
Let’s get started…
You have a collection named Clients .
You have a dataset named Client Dataset connected to the Clients collection.
You have a table named table1 connected to the Client Dataset.
Each column in the table is connected to the appropriate field in the collection.
Each column in the table is linked to the editing page (a dynamic page).
The dynamic page has a URL something like this: Clients/{Name} where NAME is the name of the column in the Clients collection. This is defined in the Page Settings panel of the dynamic page.
Let me know how we did on the checklist so we can continue.
I got it fixed. Only the page editing names needed to be dynamic, because it is necessary to create a dynamic sub page with the client name, generating a new URL in real time. The new URL allows you to edit the fields. The form page and Page with table do not have to be dynamic, just add a dataset. The Yisrael’s tip was important for me to identify the error. Thank you!