Jairo Esau Romano Rodriguez
Posts: 0
Joined: Thu Jan 02, 2014 9:49 am

Image with href

you guys use this to make a maping ,

Code: Select all

         { 

             "source": "$['body']['rows'][i]['value']", 
             "target": "$['mobilelistitem_9']['mobileimage_15:image']" 

         } 

but this dont work
,

Code: Select all

         { 

             "source": "$['body']['rows'][i]['value']", 
             "target": "$['mobilelistitem_9']['mobileimage_15:href']" 

         } 

how can i add a dynamic link to an image component???

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image with href

Hi Jairo,

That's not good idea to access not specified in documentation code.

Please follow the solution below to achieve you goal:

  1. Open service response mappin.

  2. Make link from needed response parameter to image component - visible attribute.

  3. Click on "JS" for this link.

  4. Populate it with following JS code:

    pre

    //"value" variable passed by the link.
    element.attr("href", value);

    //Always return true - to get this component always visible.
    return true;

    /pre

    Regards.

Jairo Esau Romano Rodriguez
Posts: 0
Joined: Thu Jan 02, 2014 9:49 am

Image with href

Image

i am doing what you said now, but even that i can see the image when i see on inspect element the href atribute is null, what can i do man?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image with href

Jairo,

Should work..

Did you make link to "asset" property of the image component in the mapping?

Please give us your app public link and describe steps to reproduce this problem in your app.

Regards.

Jairo Esau Romano Rodriguez
Posts: 0
Joined: Thu Jan 02, 2014 9:49 am

Image with href

No i did not, but i did it in the code i show in the last comment picture

http://appery.io/app/mobile-frame?src...

Jairo Esau Romano Rodriguez
Posts: 0
Joined: Thu Jan 02, 2014 9:49 am

Image with href

Yurii, help me man!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image with href

Hi Jairo,

Ok, please create link from your response parameter to the "asset" property of image component.

Regards.

Jairo Esau Romano Rodriguez
Posts: 0
Joined: Thu Jan 02, 2014 9:49 am

Image with href

YES, BUT HOW WILL THAT HELP ME?

NOW THE IMAGE APPEARS, THE ONLY THING IS THAT IT HAS NO HREF

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image with href

Hi Jairo,

It seems you just don't have content in response parameter that you have linked to the "Visible" property.

Note: if you don't have value in linked response parameter - link(and JS) will not executed.

to be sure you have there values please use following js code instead of yours:

pre

console.log("inside link");
console.log("value = " + value);

element.attr("href", value);
element.attr("src", value);
return true;

/pre

Regards.

Return to “Issues”