voyent
How to add a dynamic image to ice:outputResource  XML
Forum Index -> Components
Author Message
davisoski

Joined: 08/Nov/2007 00:00:00
Messages: 183
Offline


Hi.

I'm populating a ice:outputResource from a list of documents. Each document has content and a image.

Is possible to add this dynamic image to outputresource as in ice:graphicImage????. In all the examples it use a static image form url.

Thanks

philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Yes, an outputResource can be dynamically bound to a backing bean Resource property.

Philip

.
davisoski

Joined: 08/Nov/2007 00:00:00
Messages: 183
Offline


Hi Patrick.

Thanks,

I mean to image property in outputResource as in ice:graphicImage.

This is my code (it render a list of downloabled pdf documents)


<ui:repeat value="#{cms.listadoDocumentosPaginaInicio}"
var="listItem">
<td><ice:outputResource label="#{msgs['descargar.pdf']}"
resource="#{listItem.resource}" image="#{listItem.preview}"
mimeType="application/pdf" alt="#{listItem.titulo}"
title="#{listItem.titulo}" fileName="descarga"
attachment="true" shared="false"
style="width:100px;height=80px;" /></td>
<td><ice:graphicImage
url="./xmlhttp/images/bg_vertical_blue_small.png"
align="center" style="border:none;" height="10px" width="40px" />

</td>
</ui:repeat>

if I use
url="#{listItem.preview}"

in ice:graphicImage everything works great. It render my image.

That's what I want to do in ice:outputResource (render the image from my list)

Thanks
artzambrano

Joined: 21/Mar/2007 00:00:00
Messages: 177
Offline


Hello davisoski,

Things should work if you use image="#{listItem.preview}" in ice:outputResource. I just tried binding an image path to it (instead of hard-coding the path on the page) and the image is displayed correctly as part of the ice:outputResource component. If doesn't work for you, then it might be a bug with the component in ui:repeat or with the specific version of ICEfaces you're using.

What version of ICEfaces are you using?

Try binding an image to a single ice:outputResource outside of ui:repeat to see if the problem is only when using ui:repeat or if it's a general problem with the component.

Art Zambrano
ICEsoft Technologies Inc.
davisoski

Joined: 08/Nov/2007 00:00:00
Messages: 183
Offline


Hi.

Thanks for reply.

I'm using 1.8.2 and I'm not be able to update to newer version.

When you talk about a bug with the component in ui:repeat, what kind of bug do I must to find??.

my "#{listItem.preview}" works great with ice:graphicImage.

I'll try to do it as you comment.

UPDATE:

This is how I have done:
<ice:outputResource label="#{msgs['download.pdf']}"
resource="#{cms.listadoDocumentosPaginaInicio[0].resource}"
image="#{cms.listadoDocumentosPaginaInicio[0].preview}"
mimeType="application/pdf
alt="#{cms.listadoDocumentosPaginaInicio[0].titulo}"
title="#{cms.listadoDocumentosPaginaInicio[0].titulo}"
fileName="descarga" attachment="true" shared="false"
style="width:100px;height=80px;" />

Download works great, but not the image

Thanks
artzambrano

Joined: 21/Mar/2007 00:00:00
Messages: 177
Offline


I could never reproduce this issue.

I used the component-showcase application and I modified the 'Download Resources' demo to use a value binding for the image attribute of the last ice:outputResource on the page (pdf file). I simply bound it to an existing property in the application, one of the autocomplete values (image="#{selectInputText.selectedCityValue1}"), and I entered '/images/button-submit.gif' in the autocomplete demo to save the value, and then I loaded the 'Download Resources' demo, and I could see the image being loaded correctly. Then, I entered the empty string in the autocomplete demo, and there was no image in the ice:outputResource component, as expected. Then, I tried entered other image paths, and the images were loaded correctly.

So, just try using the last 1.8.2 patch and your problem should be fixed. If you can upgrade at all, then, just use a graphic image or some other work around at the app level.

Art Zambrano
ICEsoft Technologies Inc.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team