I have one page that displays product types using a Repeater connected to a DataSet. When the user clicks one of the items, I need to be able to navigate to another page that displays all of the products of the selected type - using another Repeater, connected to another DataSet.
Do you mean you want to create a filter or category page? When visitor select one of the category, jumping or showing product data, which refer to category selected.
I have one page that displays a job description and a button to souscribe. When the user press that button i want to show another page that displays a form that the user will fill. but how can i show to title of the job on the second page ?
The quickest way to pass that data would be session storage, which would look something like this.
On Page A
import {session} from 'wix-storage';
function anyFunction(){
session.setItem('my_item_key',item);//Keep in mind, 'item' must be a string.
}
On Page B
import {session} from 'wix-storage';
function needsTheData(){
let result = session.getItem('my_item_key'); //Where result will be a string.
}
The reasons we use session and not local is that I’m presuming data passed between pages should be session specific, you wouldn’t want to see it again when you reopen the browser.
To remove the data you can use session.clear() for all data or session.removeItem(‘my_item_key’) for each piece of data.
It’s actually any key that you decide on, not linked to the database or the id. So if you’re storing a store category from a click for example, you could say session.setItem(‘storeCategory’,categoryFromClick);
I think I’m starting to understand, so basically you provide a key for the other page to be able to refer to? the thing that is confusing me is how does either page know what the value of the field you are transferring from/to is?
Also the page I’m trying to transfer the info from is a dynamic page to standard page, so the data will be different if the on_click is used depending what course the customer is looking at.
The below example is from a dynamic page, this displays a chosen course but with different dates, if the customer likes the look of the start date in #date3 then clicks bookhere3, this will redirect them to a standard page for details and payment
I found a solution that works for the data transfer to the new page, but can’t get it to work for the relevant button clicked… not sure if that’s of any help?
P.S. I am just carrying the Price over so that I can setup a Stripe Payment API on the 2nd Page. The data from Page 1 however goes into a Database before redirecting to Page 2.
It works for me, you need to set a On View Port Enter for the second Page.
import {session} from 'wix-storage';
export function text2_viewportEnter(event, $w) {
//Add your code for this event here:
const price = session.getItem('price');
$w('#text2').text = price;
}