Page 2 of 2

Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 12:49 am
by Ralph Smith

Marina, I'm still lost. I tried putting a grid (1 row, 2 columns) with labels in them. I mapped two fields to the text of the labels and $ to the grid but still nothing shows up in the page. Any other suggestions? Thanks much for your help.


Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 12:45 pm
by Kateryna Grynko

Hi Ralph,

Are you sure there is a column "local_user_id" in the collection?
Maybe your JavaScript code for where parameter should be the following:
codereturn '{"_id": "' + value + '"}';/code


Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 3:04 pm
by Ralph Smith

OK. I see what you are saying and I made the correction to look like this: return '{"user_id": "' + value + '"}';

But I don't know how to get it to evaluate to the local storage variable called local_user_id.

I have mapped to variable local_user_id from the response to the login of my previous screen. (Two screens Startscreen with login and Welcome Screen to disply items for the user that logged in).

The other place I'm missing knowledge is how to even examine what I have in the local_user_id. I tried creating a simple alert popup but I don't seem to be able to reference the field correctly. I wanted to place the alert in the Success action to see what I had. Sorry to be so dumb :(. Ralph Image Image


Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 6:18 pm
by Maryna Brodina

Hi,
1) to check content of local storage variable you can add button and on click run the following code:
codealert(localStorage.getItem('local_user_id'));/code
or in mapping add JS with code:
codealert(value);/code
to see what is going to be saved into local storage variable.
2) could you give us more details on your DB structure? How table Blackmen and user's table in BD File are connected?


Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 6:59 pm
by Ralph Smith

Hi Marina. Is there any way I can give you access to the test app I'm using for your help? I searched and found another thread that someone else had the same problem. Steven replied to that one and I don't want to where out my welcome. We are trying to finish up anther app for Monday that we need this technique on. This one is real simple, only two pages and two services (login and query).

Ralph


Need help with a query through a local variable.

Posted: Fri Jul 12, 2013 7:59 pm
by Maryna Brodina

Please share your project and DB with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a