Joe Braybrook6619533
Posts: 0
Joined: Wed Jan 29, 2014 3:22 pm

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

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

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

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

Hi Joe,

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

Joe Braybrook6619533
Posts: 0
Joined: Wed Jan 29, 2014 3:22 pm

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

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

Joe Braybrook6619533
Posts: 0
Joined: Wed Jan 29, 2014 3:22 pm

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

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?

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

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

Hi Joe,

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

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

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

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

Return to “Issues”