Nikolai Grachev
Posts: 0
Joined: Fri Jul 25, 2014 7:55 am

Response shows old value of variable

Hi

There are two buttons in my app - button1 and button2. If click button1 - app shows text from 1.txt from DB, if clicking button2 - app shows text from 2.txt from DB.

Everything is working good, I have tested app. But at this stage (shown at screenshot) I have problem.

Image

JS for "loc_file" parameter:

var db_file = localStorage.getItem("loc_file");
alert(db_file);
var db_url = db_begining_url+ dbId +"/" +db_file;
Apperyio("Book_text_label").load( db_url );

Parameter "fileName" is passed to "Book_title_label" correctly. But script works not right - app shows text that corresponds to previous clicked button and variable "db_file" is previous too.

Example: if I click button1 two times and then click bitton2 app whould show:

"Book_title_label" corresponds to button2 (correct)
"Book_text_label" corresponds to button1 (previos click - not correct).

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Response shows old value of variable

Hello!

When you run code in mapping, LSV is not set yet. It will be set to the value returned by code in mapping. In JS code in mapping, current value you map is in value variable. Use this value instead reading from LSV.

Nikolai Grachev
Posts: 0
Joined: Fri Jul 25, 2014 7:55 am

Response shows old value of variable

Thanks!

Return to “Issues”