Crystal Ege
Posts: 0
Joined: Wed Mar 26, 2014 6:58 pm

Populating an image url from a REST service, Appery overwriting image source url

I am having trouble appending a url to an image file name. I have a REST service mapped to the image component and have added the following javascript.

$(element).attr( "src", "http://166.78.237.229/CatalogFiles/" + value);

The image source is updated but Appery is overwriting it after the image loads.

Here is the header information:
Remote Address:166.78.237.229:80
Request URL:http://166.78.237.229/CatalogFiles/on...
Request Method:GET
Status Code:200 OK (from cache)

Remote Address:107.22.249.220:80
Request URL:http://appery.io/app/view/76bda11c-af...
Request Method:GET
Status Code:302 Moved Temporarily

Any idea on how stop Appery from overwriting the image source?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Populating an image url from a REST service, Appery overwriting image source url

Hi Crystal -

What you're trying to achieve as a result?

Crystal Ege
Posts: 0
Joined: Wed Mar 26, 2014 6:58 pm

Populating an image url from a REST service, Appery overwriting image source url

Currently, the image control url is only the image. For example "image.jpg"
I am trying to append the source url of the images with http://166.78.237.229/CatalogFiles/im....

I have a clickable list control that is populating from a REST service. The list control displays "categories" and associated images for the category.

Through debugging, I discovered that the Javascript is appending the url but Appery is overwriting the image url when looping through the list control continue populating the "categories".

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

Populating an image url from a REST service, Appery overwriting image source url

Hi Crystal,

Remove Image component mapping and Image URL won't be changed.

Crystal Ege
Posts: 0
Joined: Wed Mar 26, 2014 6:58 pm

Populating an image url from a REST service, Appery overwriting image source url

I cannot remove the image component mapping. It dynamically sets the image src name.

I need to append the image src to display the full path to the image src not just the file name because the image files are not located within appery.

Appery was replacing the url with each loop.

I added javascript to update all the image urls if the service is successful.

function ListViewImgShow(){
$("img.ListViewImg").each(function (index, element){
/* alert($("img.ListViewImg").eq(index).attr("src"));*/
$(".ListViewImg").eq(index).attr("src", "http://url.com/CatalogFiles/" + $("img.ListViewImg").eq(index).attr("src") );
});

This is working. Thank you for your assistance

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

Populating an image url from a REST service, Appery overwriting image source url

Thank you for the update. Let us know if you need any further help.

Return to “Issues”