Hi.
I have a question regarding sending data back to the page that I got it from by using router… I got a feeling that it might not be right, and it might be right at the same time… but in the end it is not working…
I sent those values (basicMoney, switchTop, switchDown, lowerPercent, minPrice1, maxPrice1, avgPrice1)
by making it as a serializable variable, randomValueCal, from “home” page to “random” page
function goToRandomNumberPage(arg) {
var minPrice1 = minPrice.value;
var maxPrice1 = maxPrice.value;
var avgPrice1 = avgPrice.value;
var randomValueCal = {basicMoney, switchTop, switchDown, lowerPercent, minPrice1, maxPrice1, avgPrice1};
router.push("random", {"randomValueCal": randomValueCal});
}
and I fetch those data from “random” page with
var randomValueCal = this.Parameter;
var basicMoney = randomValueCal.map(function(x) {
return x.randomValueCal.basicMoney;
});
I tried to send basicMoney and lowerPercent value back to “home” page from “random” page by using router…
function goBack() {
var basicMoney1 = basicMoney.value;
var lowerPercent1 = lowerPercent.value;
var arrayOfData = {basicMoney1, lowerPercent1};
router.push("home", {"arrayOfData": arrayOfData});
}
Finally this is how I tried to fetch data from “random” page from “home” page…
but somehow it keeps saying that ValueFromRandomPage is undefined…
var tempValueFromRandomPage = this.Parameter;
var ValueFromRandomPage = tempValueFromRandomPage.map(function(x) {
return x.arrayOfData.basicMoney1.value;
});
console.log("ValueFromRandomPage has value: " + ValueFromRandomPage.value);
What am I doing wrong??
Thank you for your help and interest as always!!