Zamiel
asked on
How to assign an image url dynamically?
Im trying to present a group of products on a order page and to this end i also need to display a small image of each product. The data is presented on the page using Netui:callcontrol to retrieve the data from the database control. The images are saved on the webserver and i was planning to merely link to them.
Now i was thinking i could retrieve the image url like all the other data by referring to the element in the itemcontainer. for example...
<netui:image src="{container.item.img}" />
However this is not possible..
Is there anyone with an idea of how to achieve this? or perhaps another solution to this problem?
Now i was thinking i could retrieve the image url like all the other data by referring to the element in the itemcontainer. for example...
<netui:image src="{container.item.img}"
However this is not possible..
Is there anyone with an idea of how to achieve this? or perhaps another solution to this problem?
ASKER
because it won't assign the value of the container item to the image source. The result of trying to use " <netui:image src="{container.item.img}" />" is an image that is not availiable. The url for the image in the browser is as follows...
http://localhost:7001/resources/images/{container.item.link}
so it is not possible to assign values to an image dynamically.
http://localhost:7001/resources/images/{container.item.link}
so it is not possible to assign values to an image dynamically.
ASKER
ups.. should have been http://localhost:7001/resources/images/{container.item.img}
weblo 8.1, 9, 10 ?
Emmanuel
Emmanuel
ASKER
weblogic 8.1
plz provide the entire jsp code
Emmanuek
Emmanuek
ASKER
here you go..
<%@ page language="java" contentType="text/html;cha rset=UTF-8 "%>
<%@ taglib uri="netui-tags-databindin g.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.t ld" prefix="netui-template"%>
<netui-data:declareControl controlId="database" type="resources.database.d atabase">< /netui-dat a:declareC ontrol>
<netui:html>
<head>
<title> Web Application Page </title>
</head>
<body>
<table class="tablebody" border="1">
<netui-data:callControl resultId="product_SelectAl lResult" controlId="database" method="product_SelectAll" ></netui-d ata:callCo ntrol>
<netui-data:repeater dataSource="{pageContext.p roduct_Sel ectAllResu lt}">
<netui-data:repeaterHeader >
</netui-data:repeaterHeade r>
<netui-data:repeaterItem>
<tr>
<netui:form action="show_products_upda te">
<td>
<img src="../../resources/image s/{contain er.item.im g}" border="0">
</td>
<td>
Code:<netui:label value="{container.item.pro duct_code} " defaultValue=" "></ne tui:label> </td>
<td>
Name:
<netui:anchor formSubmit="true" >
<netui:label value="{container.item.pro duct_name} " defaultValue=" "/>
</netui:anchor>
</td>
<td>
Price:<netui:label value="{container.item.pri ce}" defaultValue=" "></ne tui:label>
</td>
<td>
Max:<netui:label value="{container.item.max }" defaultValue=" "></ne tui:label>
<netui:hidden dataSource="{actionForm.pr oduct_id}" dataInput="{container.item .id}" />
</td>
</netui:form>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter ></netui-d ata:repeat erFooter>
</netui-data:repeater>
</table>
</body>
</netui:html>
<%@ page language="java" contentType="text/html;cha
<%@ taglib uri="netui-tags-databindin
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.t
<netui-data:declareControl
<netui:html>
<head>
<title> Web Application Page </title>
</head>
<body>
<table class="tablebody" border="1">
<netui-data:callControl resultId="product_SelectAl
<netui-data:repeater dataSource="{pageContext.p
<netui-data:repeaterHeader
</netui-data:repeaterHeade
<netui-data:repeaterItem>
<tr>
<netui:form action="show_products_upda
<td>
<img src="../../resources/image
</td>
<td>
Code:<netui:label value="{container.item.pro
<td>
Name:
<netui:anchor formSubmit="true" >
<netui:label value="{container.item.pro
</netui:anchor>
</td>
<td>
Price:<netui:label value="{container.item.pri
</td>
<td>
Max:<netui:label value="{container.item.max
<netui:hidden dataSource="{actionForm.pr
</td>
</netui:form>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter
</netui-data:repeater>
</table>
</body>
</netui:html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
aha i see.. so i can just use a netui:image instead :)
Why do you say that it's not possible tu use something like this : <netui:image src="{container.item.img}"
?
Emmanuek