Manabendra Gogoi
Posts: 0
Joined: Sun Jan 18, 2015 2:59 pm

How to create and map a Javascript variable in Appery, 2015

Could you please throw some light on how in this tutorial: http://devcenter.appery.io/tutorials/... you could map the javascript variable "listTables" to the response of the service. I mean, you can't do it that way in the latest version of appery, I believe. Is there someway I could use the same code and map the javascript just like in the old version? Further, I need to know what will happen to the created offline database "Wedding 0.1" (which I believe is Web SQL) once we exit the app? Will the data still be stored and hence be available next time we start the app even without connectivity?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to create and map a Javascript variable in Appery, 2015

Hi Manabendra -

Yes, you can still use your variable, but it should be used inside generic service response as a return value. You can use that generic service in your mapping.

Manabendra Gogoi
Posts: 0
Joined: Sun Jan 18, 2015 2:59 pm

How to create and map a Javascript variable in Appery, 2015

Dear Illya,

I think you misunderstood what I asked. Just have a look at the example response mapping. The "body.$" is directly mapped to the javascript variable "listTables". I would request you to elaborate how to achieve such mapping as I am certain there is no way to map directly to a javascript variable. Please provide an example if possible.

Regards,
Manabendra

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to create and map a Javascript variable in Appery, 2015

Hello,

You can make link from array response to array storage in following way:

  1. Open "Storage and models".

  2. Add new model with type "Array". http://prntscr.com/4uey7v/direct

  3. Add storage with type model from 2nd step. http://prntscr.com/4ueyq8/direct

  4. Navigate to "success" mapping.

  5. Make link from "$" to storage from 3rd step: http://prntscr.com/4ueyzi/direct

    Regards.

Manabendra Gogoi
Posts: 0
Joined: Sun Jan 18, 2015 2:59 pm

How to create and map a Javascript variable in Appery, 2015

Thanks Yurii! I have absolutely understood your point and it is working.

Regards,
Manabendra

Return to “Issues”