I have a couple of pages that use a dynamic dataset to display items in a repeater. On each item there is a Button with an event to EDIT/UPDATE that item by using a session variable and opening a User input form in Read/Write Mode. This has been working for a number of months. Now it has mysteriously stopped working. Here is the Update Button Click event code....
export function updateButton_click(event, $w) { let $item = $w.at(event.context); let CarId = $item("#dash").text; let eDate = $item("#origDate").text; session.setItem("Edit#Sel", "Edit"); session.setItem("CarId",CarId); session.setItem("eDate",eDate); console.log("CarId: ", CarId) console.log("eDate: ", eDate) }
==========================================
The Update Form page code:
import {session} from 'wix-storage'; import wixData from 'wix-data'; import wixUsers from 'wix-users'; $w.onReady(function () { let formType = session.getItem("Edit#Sel"); let CarId = session.getItem("Car-Id"); let eDate= session.getItem("eDate"); console.log(CarId); console.log(eDate); if(formType === "Edit"){ $w("#dataset1").setFilter(wixData.filter() .eq("Dash_no", CarId) .eq("Entry_Date", eDate) ) } else { $w("#saveButton").label = "Submit"; } });
I was trying to use a dynamic page. Went back to a regular page update form. Used session variable "_id" to load data from repeater item. Still have no idea why the previously working dynamic page update form stopped working!