m z
Posts: 0
Joined: Sat Nov 02, 2013 1:39 am

camera service display in list

I have a phonegap camera service that gets called from a button placed inside a dynamic collapsible list box (list loaded from a database service). When I click on the button to launch the service, the camera service is launched and the photo is placed where I expect it.

My problem is that every picture in the different collapsible items gets set to the same picture (i.e., I click on first list item - click on take photo- photo displayed ok - click on next list item - click on take photo - photo displayed ok - first photo gets overwritten when I expect it to stay the same).

How do I set the image properly from the camera service output?

Image

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

camera service display in list

Hi,

Most probably this is caused by your service structure.
To display a new image in every new item you should map Camera response to a localStorage instead of component, and then use it where needed.

m z
Posts: 0
Joined: Sat Nov 02, 2013 1:39 am

camera service display in list

Can you help me with a code snippet to set the image component from local storage?

Also, how would I populate only the one image that I'm interested in (inside the collapsible item that was selected)?

As I originally mentioned, I can get the camera service to populate the box shown above. My problem is that every image box gets populated (all collapsible items) with the same picture, which was the last one the user takes.

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

camera service display in list

Hi,

You can get an array of images:prevar arr = Appery("mobileimage");/preWhere 'mobileimage' is a name of Image component.

Then you can set an image from variable on each array index:prearr.attr("src":image);/preWhere 'image' is a name of variable containing image.

Return to “Issues”