Page 1 of 3
Mapping an image
Posted: Tue Oct 15, 2013 1:49 pm
by Romeo
Hello!, I tried to map an image with a few solutions posted here, but, i just can't..
what I'm trying to do is show an image depends of the result of a service, I tried by url/ Json, image data, JS value return with the name of the image and set the src property in js mapping..
thanks in advance..
Mapping an image
Posted: Tue Oct 15, 2013 2:35 pm
by Kateryna Grynko
Hi Romeo,
Where do you store the image (in application, in database, on third-party server)?
Anyway, you would need to specify full path to the file.
Mapping an image
Posted: Tue Oct 15, 2013 2:57 pm
by Romeo
Hi Katya, the images are in mysql DB, and it is correct, I put the full path value and the name of the image as return value:
this way in mapping JS :
$(''mobileimage_').attr('src', 'http://mydomain/images/'+value);
in url Json response, mapped the full path of the image in server to the mobileimage_n component
Mapping an image
Posted: Tue Oct 15, 2013 6:26 pm
by Maryna Brodina
Hello! Where do you use the code you've posted above? Could you please send mapping screenshot?
Mapping an image
Posted: Wed Oct 16, 2013 3:08 am
by Romeo
Mapping an image
Posted: Wed Oct 16, 2013 7:40 am
by Kateryna Grynko
Hi Romeo,
Please replace your JavaScript with the following:
codereturn 'http://mydomain/images/' + value;/code
Mapping an image
Posted: Wed Oct 16, 2013 2:44 pm
by Romeo
Good morning!
I think I tried that line, but I'll check again!
Mapping an image
Posted: Wed Oct 16, 2013 3:27 pm
by Romeo
Mapping an image
Posted: Wed Oct 16, 2013 6:20 pm
by Maryna Brodina
Hello! We'll take a look.
Mapping an image
Posted: Wed Oct 16, 2013 7:57 pm
by Maryna Brodina
Should be working.. In response you get only image name? You can check that. On service Test tab specify request parameters and click Test to receive response. In address line put server URL which you've set in mapping and received in service test image name. You can also inspect element in browser and check image src attribute value.