John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

how to pass data from an incoming json response to local storage, then back to my server?

ok yes i do understand now the meaning of the UpperString... However, Im asking if you just please tell me the full code i need to wrap this issue up. In my project I dont need to write much JS and I dont have a lot of experience in JS. Therefore, I would greatly appreciate it if i can get a straight answer instead of back and forth stuff. Again, I will explain what i am doing...

I am loading a select menu on arrival of a certain page. I was successful in completing that task. The value = 'id' and the label = 'driver_name'

Now like you said I mapped already the 'id' to local storage (driver_id_list) as shown in the very 1st image in this posting. The only question i have regarding that is, the user will be selecting one of those id values from a list that populates a select menu. Therefore, the way I mapped it, doesn't that mean I'm storing the entire list of id's in local storage? If that is the case, the logical thing to do is store only one value (the value the user has selected from the select menu) or filter through that list to figure out which one the user selected. And now Im thinking that the way i mapped is either totally wrong or I can still use the mapping, but there must be some JS code to the that local storage element to only save just one value. That value must be what the user has selected from the select menu.

The next step in this process will be once the user has selected his choice of 'driver_name' along with any other info he types into that form, the user hits the submit load button. On click, all that info plus the selected driver_name will be sent (as a post) back to the server.

I have made a sincere effort to try to make this work without success. And like i said before, instead of just sending me a link this time, I would really appreciate someone telling exactly what i need to do including the full (not partial (The value = 'id' and the label = 'driver_name' )) code for any and all elements i need to attach it.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

how to pass data from an incoming json response to local storage, then back to my server?

BTW, I only need to send back to the server just the 'id' - the 'driver_name' is not needed, it was just necessary to load the select menu for the user to see that info.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to pass data from an incoming json response to local storage, then back to my server?

This show exactly how to map data from local storage to service and from service to local storage:
http://docs.appery.io/documentation/a...

Why don't you build a small two page app where you implement the functionality you want, it will be simpler to look at.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

how to pass data from an incoming json response to local storage, then back to my server?

yes i reviewed those steps and does not explain how to pass the selected value from a select menu. And as far as building a 2 small pages for this specific task im trying to accomplish (passing a selected value from a select menu) - i dont see how it would help..

like i asked before, instead of going back and forth on this, can you just please send me back the full codes i need on both services?? It will just make completing this task much easier and faster for both you guys and me..

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

how to pass data from an incoming json response to local storage, then back to my server?

ok it seems were getting somewhere now.BTW - I never seen that diagram before anywhere.

I have created a local storage variable called:
'driver_id_list'

So Im guessing that in the JS i have to tell it to store the selected value in that local storage variable, Right? Then, trying to figure out your code structure, I wrote my code as follows (inside the page - as shown above, for the action I Run JS):

var val = Appery("driver_id_list").val();
localStorage.setItem("id", g);

Is that correct? because Im not sure where 'driver_id_list' goes. besides that what does "Appery" mean?

Then, on the other service (submit_load), to retrieve the local storage value from 'driver_id_list' I mapped the local storage element to 'driver_id' (a request parameter)

var g=localStorage.getItem('id');

In final, i tried testing it, and still no success. Can I get review on the code I wrote?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to pass data from an incoming json response to local storage, then back to my server?

You do not need mapping from id to localStorage variable driver_id_list (because only the first id will be saved).

In the first service, fill the Mobile list with the following data: Image

To send selected value you would need to map "Selected" property to a request parameter: Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to pass data from an incoming json response to local storage, then back to my server?

Here is a project you can import and see how it works: http://ge.tt/14YfLYh/v/0?c

As for Appery function, it's described here: http://docs.appery.io/javascript-api/

John - we love to help our user and want to help you, but using Appery.io does require reading the docs and trying out some tutorials. You do need to be pretty comfortable with JavaScript, otherwise it's pretty challenging. I hope you understand.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

how to pass data from an incoming json response to local storage, then back to my server?

yes i do understand and i mentioned to you earlier that i did attempt to read the documentation, but sometimes i cant find what im looking for. As far as JS, i get a little help from a friend of mine that comes in sometimes to help, but even then he cant figure it all out. The initial code i sent you was written by my friend that has quite a lot of experience in JS after we both read your documentation. It was unclear even to him since this is a new platform.

And i dont have a problem with JS (even though i dont have a lot of experience), i just want to find out in most cases what is the code required to do something because when i learn how to write the certain code once i can implement it in many other situations.. Besides that, one of the reasons Im using your service is because theres limited coding involved with your platform. And when it is needed, for the projects im working on - once i write the correct code once I can reuse it for the same situation on many other same problems.. Im not trying to make you guys do everything for me, but do look for help (especially if i need certain code to write) if I cant figure it out. So far, i think sometimes it much longer going back and forth on an issue when i get an about answer instead of just giving me a straight answer.

So basically, i do look to you guys to help me on certain things i cant figure out - Not that im trying to take advantage of your support. I hope you understand. And I really do appreciate the help i get.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to pass data from an incoming json response to local storage, then back to my server?

We do :)

Did you try the app that I attached?

Return to “Issues”