The Problem is after directing to Url selected, Page displayed is not correct, after I refresh the page correct page is displayed. Does anyone to help me?
Below is the code for directing the selected page. First Dropdown lets user to select Country Name.
export function button2_onclick(event, $w) {
let page = $w(“#dropdown1”).value;
let path = “/Ulkeler/” + page;
$w(“#button2”).target = “_self”
wixLocation.to(path);
//Add your code for this event here:
}
You could just change it so that it goes with the dropdown user choice by using onChange as shown in this previous post here.
https://www.wix.com/corvid/forum/community-discussion/how-can-i-link-a-dropdown-user-input-element-to-a-dynamic-page
Or something like this with a dropdown onChange in your code.
import wixLocation from 'wix-location';
$w.onReady(() => {
$w('#dynamicDataset').onReady(() => {
$w("#dropdown1").onChange( (event, $w) => {
let page = event.target.value; // new page name selected
let path = "/" + page; // create path to local page
wixLocation.to(path);
});
});
});