Page 1 of 2

Selecting an image asset from data mapping

Posted: Fri Jun 22, 2012 8:02 am
by ghuisintveld

I have a REST service which returns documents, including the file type. Say the type can ben PDF or XML. I would like to display an image icon showing the file type.

I have uploaded two image assets and named one pdf.png and the other xml.png. I have mapped the service property file-format to the image asset and use the following custom javascript:

return "image/" + value + ".png";

Although this seems to be working OK (when I check the source, the src property of the image is changed to image/pdf.png), the image won't display. It looks the image URL starts with http://tiggzi.com/views/.... and the html is in http://tiggzi.com/view/.

What should I do?


Selecting an image asset from data mapping

Posted: Fri Jun 22, 2012 1:16 pm
by maxkatz

Take one of the images and add it to the page via Image component. Look at the source for the URL -- that's the link that should be used.


Selecting an image asset from data mapping

Posted: Fri Jul 13, 2012 11:14 am
by ghuisintveld

Hi Max,

I have now made an image sprite and refer to this sprite in my CSS:
background-image : url('http://project.tiggzi.com/views/82615...;

In the data mapping I've added a javascript:

element.addClass("icon32x32").addClass(value);
return "http://project.tiggzi.com/views/82615...;

The use of spacer.gif is a hack to make this work.

This all works fine, except when testing in the android mobile tester (because the URL's aren't relative?).

How can I fix this for the mobile app?

Thanks,

Gerard


Selecting an image asset from data mapping

Posted: Fri Jul 13, 2012 4:24 pm
by maxkatz

Do you mean because in the return you use an absolute URL, it does't work when testing on Tiggzi mobile app tester?


Selecting an image asset from data mapping

Posted: Wed Jul 18, 2012 10:27 am
by ghuisintveld

Exactly. The problem is that relative URL's don't seem to work when testing in the browser...


Selecting an image asset from data mapping

Posted: Wed Jul 18, 2012 1:07 pm
by maxkatz

Doesn't work in the browser or the mobile app tester?


Selecting an image asset from data mapping

Posted: Wed Jul 18, 2012 1:18 pm
by ghuisintveld

Absolute URL's don't work in the app tester.
Relative URL's don't work in de browser.


Selecting an image asset from data mapping

Posted: Wed Jul 18, 2012 1:28 pm
by maxkatz

In the web browser, what do you get if you enter the image URL in the address bar?


Selecting an image asset from data mapping

Posted: Tue Jul 24, 2012 11:29 am
by ghuisintveld

http://project.tiggzi.com/views/82615... simply seems to work OK.This is the absolute URL used in the css.

The location of the html however is http://project.tiggzi.com/view/82615d... (view, not views). This is why relative URL's don't seem to work I guess...


Selecting an image asset from data mapping

Posted: Tue Jul 24, 2012 5:02 pm
by maxkatz

The Android tester downloads the app to the phone but I don't believe it has access to the project on the web (http://project.tiggzi.com/viewi/xxxx). Just include the actual images in your app. If you need to update the image in runtime, you can do this:

Tiggzi('imageName').attr('src', 'newImage');