w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

How can I set an image that is on listitem, based on a responsevalue?

How can I set an image that is on listitem, based on a responsevalue?

I have a response with:

id: 1 or 2
name

User interface:

A list with listitem: an image + a label.

The response 'name' maps to the text on the label.
I want the image to be 'image 1.jpg' when the response 'id' is 1. And I want the image to be 'image 2.jpg' when the response 'id' is 2.

How can I do this?

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

How can I set an image that is on listitem, based on a responsevalue?

Hello! Map id to image asset, add the following JS:
codereturn "image " + value + ".jpg&quot/code
You need to set image path, if you upload images through assets here is how you can get it http://docs.appery.io/javascript-api/...

Return to “Issues”