Page 1 of 4

Image with href

Posted: Wed Nov 26, 2014 9:36 pm
by Jairo Esau Romano Rodriguez

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???


Image with href

Posted: Wed Nov 26, 2014 11:15 pm
by Yurii Orishchuk

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.


Image with href

Posted: Thu Nov 27, 2014 1:53 am
by Jairo Esau Romano Rodriguez

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?


Image with href

Posted: Thu Nov 27, 2014 5:06 am
by Yurii Orishchuk

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.


Image with href

Posted: Thu Nov 27, 2014 8:30 pm
by Jairo Esau Romano Rodriguez

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...


Image with href

Posted: Fri Nov 28, 2014 12:45 am
by Jairo Esau Romano Rodriguez

Yurii, help me man!


Image with href

Posted: Fri Nov 28, 2014 2:00 am
by Yurii Orishchuk

Hi Jairo,

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

Regards.


Image with href

Posted: Fri Nov 28, 2014 2:15 am
by Jairo Esau Romano Rodriguez

YES, BUT HOW WILL THAT HELP ME?

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


Image with href

Posted: Fri Nov 28, 2014 2:29 am
by Jairo Esau Romano Rodriguez

Image with href

Posted: Fri Nov 28, 2014 3:46 am
by Yurii Orishchuk

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.