Page 1 of 1

Take text from an api request and use it to display the equally named image asset.

Posted: Wed Jan 29, 2014 3:22 pm
by Joe Braybrook6619533

Hi, I am currently using an API which is retrieving data that i want to display, however, i also have specific images that i would like to display based on the name variable. for example, if the Text label says Ashe, i would like to take that data and set a local storage variable which would allow me to display Ashe.png in another section. Is this possible?
Screenshots :)
http://imgur.com/a/MGcg9#0


Take text from an api request and use it to display the equally named image asset.

Posted: Wed Jan 29, 2014 4:44 pm
by Kateryna Grynko

Hi Joe,

You can on event set a localStorage variable and tick "bind to component"
http://docs.appery.io/tutorials/build...


Take text from an api request and use it to display the equally named image asset.

Posted: Wed Jan 29, 2014 5:20 pm
by Joe Braybrook6619533

Thank-you very much, i'll give it a whirl.


Take text from an api request and use it to display the equally named image asset.

Posted: Mon Feb 03, 2014 1:05 pm
by Joe Braybrook6619533

Hi Katya, i am still struggling for some reason, i have used the local storage, and even written some javascript which changes the src value of the image to the correct name. but the image will still not display?

Would it be easier if i shared the project with you so you can see?


Take text from an api request and use it to display the equally named image asset.

Posted: Mon Feb 03, 2014 1:26 pm
by Kateryna Grynko

Hi Joe,

Yes. Please share it with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a


Take text from an api request and use it to display the equally named image asset.

Posted: Mon Feb 03, 2014 1:30 pm
by Joe Braybrook6619533

Ok, did that.


Take text from an api request and use it to display the equally named image asset.

Posted: Mon Feb 03, 2014 9:53 pm
by Maryna Brodina

Hello!
1) Delete actions
FreeToPlay-Load-Set local storage variable
FreeToPlay-Load-Set property
2) In service restservice1 on screen FreeToPlay add response mapping from name to mobileimage_65-Asset and add the following JS in this mapping prereturn Appery.getImagePath(value+".png");/pre